From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#35708: [27.0.50]: thingatpt.el, thing-at-point-looking-at redundant Date: Mon, 13 May 2019 08:41:03 -0400 Message-ID: <87ftpih6hs.fsf@gmail.com> References: <8a73a0c9-5b38-4089-2780-28e62a1e162b@easy-emacs.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="100482"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux) Cc: 35708@debbugs.gnu.org To: Andreas =?UTF-8?Q?R=C3=B6hler?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 13 14:42:14 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQAHW-000Q03-2b for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 14:42:14 +0200 Original-Received: from localhost ([127.0.0.1]:56676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQAHV-0006ZW-1J for geb-bug-gnu-emacs@m.gmane.org; Mon, 13 May 2019 08:42:13 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:47504) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hQAHM-0006XZ-IG for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:42:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hQAHL-00063A-5H for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:42:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59113) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hQAHK-00062n-Pz for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:42:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hQAHK-0000Hn-6F for bug-gnu-emacs@gnu.org; Mon, 13 May 2019 08:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 13 May 2019 12:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 35708 X-GNU-PR-Package: emacs Original-Received: via spool by 35708-submit@debbugs.gnu.org id=B35708.15577512731018 (code B ref 35708); Mon, 13 May 2019 12:42:02 +0000 Original-Received: (at 35708) by debbugs.gnu.org; 13 May 2019 12:41:13 +0000 Original-Received: from localhost ([127.0.0.1]:44419 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQAGW-0000GL-Q4 for submit@debbugs.gnu.org; Mon, 13 May 2019 08:41:13 -0400 Original-Received: from mail-io1-f54.google.com ([209.85.166.54]:45613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hQAGU-0000G4-BV for 35708@debbugs.gnu.org; Mon, 13 May 2019 08:41:11 -0400 Original-Received: by mail-io1-f54.google.com with SMTP id b3so9838323iob.12 for <35708@debbugs.gnu.org>; Mon, 13 May 2019 05:41:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=tfYUjXuOwZ5ubrBTMGJxgD5PP7/XdpgUGj+hZ8d9cVE=; b=lZxAe1AqO3CJG1ur8WsjvJKiBifXRvslSLvZrgAs3QvBBIIgkn3cMcYMj73zbtK9ZU HQIA8EawtoSpofzQ7Y725NQQmIqcwUKpmMtEfrzb5NveDXcOC+8lKvoC2EpdijPQ5cBa 9flUc0kP6++3oCX19WYth6dgwHdap16mz24JXnqOceUOPvEwkJJN5V4nROE18oi5UvyL 7P4FMeky6vDHxLqD2aYrQj/I8CfMs+aQ0p12DqxIj8qFL1fRlZfahPFygJ9/tNdyYRAa qRD6u+5H+Ow+RyuUZQeE/wPYdxDoSqb42XetTZ5g08ToJ+oEnCuU6m/jvvzzBq5uBBDt rsAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=tfYUjXuOwZ5ubrBTMGJxgD5PP7/XdpgUGj+hZ8d9cVE=; b=RAFrruurY8FSPkiu327Fgsbn53ZkXURBWGBjPJZ7djttiRkOu1PZNS7NyDCQAY4s/C ur4FcYUP6wrXC2RgGXvPGo1mVd/eZasvWDwlVsfJghp5RL9DNX4JbKg6wT8PvEUU3ApX M4s2zUj8/cvbhRKsQdtLxr/Gn8GNabp74eof5ApWyUqUldXA5OMh1UVoBaH8Y16/WJT/ 4b+YcCc/SuUzdow/SInxvId9oNILaIkMNFowpNpxIz514h+ZjPxMBPpuWCWIfWJwPd8v HB113XWrtGST2MK/n5SrF6KeG7F+jNMMTaXgYKdn5cNQLEP0bFRkyOLG6ibbpVG/omxv soLw== X-Gm-Message-State: APjAAAXX4ohqa609gHYM/8thhYtbdPlyPFtMKgyGWmUAiXbbzrkTJPni QGQ19uc9jmp3APGQ1ywsz7PSQYeI X-Google-Smtp-Source: APXvYqytFnJKhNbCOPfpAtvvk9kfWcGAgVWXCedxJwlscp0IvJl4QYfWrrddQ9bVa+gqTffJw8TfgA== X-Received: by 2002:a5e:8216:: with SMTP id l22mr14691034iom.269.1557751264314; Mon, 13 May 2019 05:41:04 -0700 (PDT) Original-Received: from minid (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.gmail.com with ESMTPSA id i141sm6159745ite.20.2019.05.13.05.41.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 13 May 2019 05:41:03 -0700 (PDT) In-Reply-To: <8a73a0c9-5b38-4089-2780-28e62a1e162b@easy-emacs.de> ("Andreas \=\?utf-8\?Q\?R\=C3\=B6hler\=22's\?\= message of "Mon, 13 May 2019 09:19:20 +0200") 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: 209.51.188.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:159174 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Andreas R=C3=B6hler writes: > as result of =E2=80=98thing-at-point-looking-at=E2=80=99 finally is deliv= ered by > =E2=80=98looking-at=E2=80=99, > don't see any sense in calling =E2=80=98re-search-forward=E2=80=99 first. The test added below fails if the re-search-forward in thing-at-point-looking-at is commented out. Does that tell you what the "sense" is? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Add-thing-at-point-looking-at-test-Bug-35708.patch Content-Description: patch >From 79b55e8e6dfee9cba9e464860546dbab2cdd36d8 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Mon, 13 May 2019 08:39:00 -0400 Subject: [PATCH] ; Add thing-at-point-looking-at test (Bug#35708) * test/lisp/thingatpt-tests.el (thing-at-point-looking-at): New test. --- test/lisp/thingatpt-tests.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/lisp/thingatpt-tests.el b/test/lisp/thingatpt-tests.el index 452fcc6895..339a4a4b81 100644 --- a/test/lisp/thingatpt-tests.el +++ b/test/lisp/thingatpt-tests.el @@ -131,4 +131,15 @@ (ert-deftest thing-at-point-url-in-comment () (goto-char 23) (should (equal (thing-at-point 'url) "http://foo/bar(baz)")))) +(ert-deftest thing-at-point-looking-at () + (with-temp-buffer + (insert "1abcd 2abcd 3abcd") + (goto-char (point-min)) + (let ((m2 (progn (search-forward "2abcd") + (match-data)))) + (goto-char (point-min)) + (search-forward "2ab") + (should (thing-at-point-looking-at "2abcd")) + (should (equal (match-data) m2))))) + ;;; thingatpt.el ends here -- 2.11.0 --=-=-=--