[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: (match-end 0) returns 1 instead of the actual position
From: |
Yuan Fu |
Subject: |
Re: (match-end 0) returns 1 instead of the actual position |
Date: |
Fri, 23 Dec 2022 16:50:00 -0800 |
> On Dec 22, 2022, at 4:04 PM, Stefan Monnier via Users list for the GNU Emacs
> text editor <help-gnu-emacs@gnu.org> 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)
>
> Define "run".
>
> These are 2 expressions and the result will depend on how you combine
> them (more specifically it depends on what code might be run in-between).
>
>> It returns 1 instead of the end of xxx after point.
>
> Any chance you used `C-x C-e` or `M-C-x` twice, meaning that a whole lot
> of things like timers, `post-command-hook`s and whatnot can/will run
> between the two?
Ah that’s exactly it, I used M-; twice. That’s why I can’t bisect out anything
meaningful. Thanks!
Yuan