all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yuan Fu <casouri@gmail.com>
To: Emanuel Berg <incal@dataswamp.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: (match-end 0) returns 1 instead of the actual position
Date: Fri, 23 Dec 2022 16:51:37 -0800	[thread overview]
Message-ID: <2C24A6D7-3DBC-4576-A6E9-799974830AB9@gmail.com> (raw)
In-Reply-To: <87k02jauog.fsf@dataswamp.org>



> On Dec 22, 2022, at 3:24 PM, Emanuel Berg <incal@dataswamp.org> wrote:
> 
> Yuan Fu wrote:
> 
>> This doesn’t happen with vanilla Emacs, but I couldn’t tell
>> which part of my config is causing it. Basically if I run
>> 
>> (looking-at "xxx")
>> (match-end 0)
>> 
>> It returns 1 instead of the end of xxx after point.
>> 
>> Is there any user option that would affect this that I’m not aware of?
>> 
>> I tried bisecting but the issue doesn’t always reproduce.
>> (It reproduce reliably when I enable all configuration, but
>> not when I comment out parts of the config ...)
> 
> ... we'll consider this a "slip", eh :)
> 
> Do the binary search algorithm of your code, Google that if
> you don't know what it refers to in this contex, when you
> understand it you'll see that you can pinpoint the bug or
> misconfiguration very easily and quickly.
> 
> You can then tell us what it was, also!

As Stefan pointed it out, it was my slip in how I ran the test. I did try bisecting but that didn’t turn up anything because I ran the code in the wrong way.

Yuan


  reply	other threads:[~2022-12-24  0:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-22 23:18 (match-end 0) returns 1 instead of the actual position Yuan Fu
2022-12-22 23:24 ` Emanuel Berg
2022-12-24  0:51   ` Yuan Fu [this message]
2022-12-23  0:04 ` Stefan Monnier via Users list for the GNU Emacs text editor
2022-12-24  0:50   ` Yuan Fu

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=2C24A6D7-3DBC-4576-A6E9-799974830AB9@gmail.com \
    --to=casouri@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=incal@dataswamp.org \
    /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.