all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@gmail.com>
To: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
Cc: 35708@debbugs.gnu.org
Subject: bug#35708: [27.0.50]: thingatpt.el, thing-at-point-looking-at redundant
Date: Mon, 13 May 2019 08:41:03 -0400	[thread overview]
Message-ID: <87ftpih6hs.fsf@gmail.com> (raw)
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")

[-- Attachment #1: Type: text/plain, Size: 364 bytes --]

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

> as result of ‘thing-at-point-looking-at’ finally is delivered by
> ‘looking-at’,
> don't see any sense in calling ‘re-search-forward’ 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?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1120 bytes --]

From 79b55e8e6dfee9cba9e464860546dbab2cdd36d8 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
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


  reply	other threads:[~2019-05-13 12:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13  7:19 bug#35708: [27.0.50]: thingatpt.el, thing-at-point-looking-at redundant Andreas Röhler
2019-05-13 12:41 ` Noam Postavsky [this message]
2019-05-13 18:31   ` Andreas Röhler
2019-05-13 19:25     ` npostavs
2019-05-14 10:02       ` Andreas Röhler
2019-05-14 10:49         ` Andreas Röhler
2019-05-14 14:34           ` npostavs
2019-05-15  6:59             ` Andreas Röhler
2019-05-15 10:11               ` Andreas Röhler
2019-05-20 17:17               ` Noam Postavsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ftpih6hs.fsf@gmail.com \
    --to=npostavs@gmail.com \
    --cc=35708@debbugs.gnu.org \
    --cc=andreas.roehler@easy-emacs.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.