* isearch replace on org-mode buffer overlays caused error
@ 2024-12-16 7:42 Christopher M. Miles
2024-12-16 10:23 ` Michael Heerdegen via Users list for the GNU Emacs text editor
0 siblings, 1 reply; 5+ messages in thread
From: Christopher M. Miles @ 2024-12-16 7:42 UTC (permalink / raw)
To: Emacs Help mailing list
[-- Attachment #1: Type: text/plain, Size: 1950 bytes --]
I do [M-%] which bind to package "pcre2el" command
`pcre-query-replace-regexp` which replace regexp Org-mode tag ":audio:"
with text ":file_audio:" in an Org-mode buffer. The tag is beautified
with package "org-tag-beautify" https://repo.or.cz/org-tag-beautify.git.
I got error when doing [M-%] which is a keybinding remapped to package
"pcre2el" command `pcre-query-replace-regexp`.
#+begin_example
Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
isearch-open-necessary-overlays(#<overlay in no buffer>)
mapc(isearch-open-necessary-overlays (#<overlay in no buffer> #<overlay in no buffer> #<overlay in no buffer>))
#f(compiled-function () #<bytecode -0x46770234ddc9000>)()
isearch-clean-overlays@magit-mode(#f(compiled-function () #<bytecode -0x46770234ddc9000>))
apply(isearch-clean-overlays@magit-mode #f(compiled-function () #<bytecode -0x46770234ddc9000>) nil)
isearch-clean-overlays()
replace-dehighlight()
#f(compiled-function () #<bytecode -0x8b10da6d0f0e86e>)()
perform-replace(":audio:" ":file_audio:" t t nil nil nil nil nil nil nil)
query-replace-regexp(":audio:" ":file_audio:" nil nil nil nil nil)
funcall-interactively(query-replace-regexp ":audio:" ":file_audio:" nil nil nil nil nil)
call-interactively(query-replace-regexp)
pcre-query-replace-regexp()
funcall-interactively(pcre-query-replace-regexp)
call-interactively(pcre-query-replace-regexp nil nil)
command-execute(pcre-query-replace-regexp)
#+end_example
I saw #<overlay in no buffer> in the backtrace. Don't know why.
Should the `isearch-open-necessary-overlays` exclude filter those
#<overlay in no buffer>?
--
[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.
Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: isearch replace on org-mode buffer overlays caused error
2024-12-16 7:42 isearch replace on org-mode buffer overlays caused error Christopher M. Miles
@ 2024-12-16 10:23 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-18 6:20 ` stardiviner
2024-12-18 6:21 ` stardiviner
0 siblings, 2 replies; 5+ messages in thread
From: Michael Heerdegen via Users list for the GNU Emacs text editor @ 2024-12-16 10:23 UTC (permalink / raw)
To: help-gnu-emacs
"Christopher M. Miles" <numbchild@gmail.com> writes:
> Should the `isearch-open-necessary-overlays` exclude filter those
> #<overlay in no buffer>?
That doesn't normally happen. Isearch will only consider live overlays
living in the current buffer.
> #+begin_example
> Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
> isearch-open-necessary-overlays(#<overlay in no buffer>)
> mapc(isearch-open-necessary-overlays (#<overlay in no buffer> #<overlay in no buffer> #<overlay in no buffer>))
> #f(compiled-function () #<bytecode -0x46770234ddc9000>)()
> isearch-clean-overlays@magit-mode(#f(compiled-function () #<bytecode -0x46770234ddc9000>))
> apply(isearch-clean-overlays@magit-mode #f(compiled-function () #<bytecode -0x46770234ddc9000>) nil)
But why is this magit-mode function called in your case?
`isearch-clean-overlays@magit-mode' tries to unfold sections in a
magit-mode buffer. I don't think it should be called in an org-mode
buffer at all. Something's wrong here.
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: isearch replace on org-mode buffer overlays caused error
2024-12-16 10:23 ` Michael Heerdegen via Users list for the GNU Emacs text editor
@ 2024-12-18 6:20 ` stardiviner
2024-12-18 12:08 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-18 6:21 ` stardiviner
1 sibling, 1 reply; 5+ messages in thread
From: stardiviner @ 2024-12-18 6:20 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
Yes, it's weird, I'm pretty sure I'm in an normal org-mode (major-mode)
buffer. Don't know why magit-mode involved.
[stardiviner] <Hack this world!> GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter: @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
On Mon, Dec 16, 2024 at 6:23 PM Michael Heerdegen via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
> > Should the `isearch-open-necessary-overlays` exclude filter those
> > #<overlay in no buffer>?
>
> That doesn't normally happen. Isearch will only consider live overlays
> living in the current buffer.
>
> > #+begin_example
> > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p
> nil)
> > isearch-open-necessary-overlays(#<overlay in no buffer>)
> > mapc(isearch-open-necessary-overlays (#<overlay in no buffer>
> #<overlay in no buffer> #<overlay in no buffer>))
> > #f(compiled-function () #<bytecode -0x46770234ddc9000>)()
> > isearch-clean-overlays@magit-mode(#f(compiled-function () #<bytecode
> -0x46770234ddc9000>))
> > apply(isearch-clean-overlays@magit-mode #f(compiled-function ()
> #<bytecode -0x46770234ddc9000>) nil)
>
> But why is this magit-mode function called in your case?
> `isearch-clean-overlays@magit-mode' tries to unfold sections in a
> magit-mode buffer. I don't think it should be called in an org-mode
> buffer at all. Something's wrong here.
>
>
> Michael.
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: isearch replace on org-mode buffer overlays caused error
2024-12-16 10:23 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-18 6:20 ` stardiviner
@ 2024-12-18 6:21 ` stardiviner
1 sibling, 0 replies; 5+ messages in thread
From: stardiviner @ 2024-12-18 6:21 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: help-gnu-emacs
Is there some other information or troubleshooting steps need I to provide?
[stardiviner] <Hack this world!> GPG key ID: 47C32433
IRC(freeenode): stardiviner Twitter: @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/
On Mon, Dec 16, 2024 at 6:23 PM Michael Heerdegen via Users list for the
GNU Emacs text editor <help-gnu-emacs@gnu.org> wrote:
> "Christopher M. Miles" <numbchild@gmail.com> writes:
>
> > Should the `isearch-open-necessary-overlays` exclude filter those
> > #<overlay in no buffer>?
>
> That doesn't normally happen. Isearch will only consider live overlays
> living in the current buffer.
>
> > #+begin_example
> > Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p
> nil)
> > isearch-open-necessary-overlays(#<overlay in no buffer>)
> > mapc(isearch-open-necessary-overlays (#<overlay in no buffer>
> #<overlay in no buffer> #<overlay in no buffer>))
> > #f(compiled-function () #<bytecode -0x46770234ddc9000>)()
> > isearch-clean-overlays@magit-mode(#f(compiled-function () #<bytecode
> -0x46770234ddc9000>))
> > apply(isearch-clean-overlays@magit-mode #f(compiled-function ()
> #<bytecode -0x46770234ddc9000>) nil)
>
> But why is this magit-mode function called in your case?
> `isearch-clean-overlays@magit-mode' tries to unfold sections in a
> magit-mode buffer. I don't think it should be called in an org-mode
> buffer at all. Something's wrong here.
>
>
> Michael.
>
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: isearch replace on org-mode buffer overlays caused error
2024-12-18 6:20 ` stardiviner
@ 2024-12-18 12:08 ` Michael Heerdegen via Users list for the GNU Emacs text editor
0 siblings, 0 replies; 5+ messages in thread
From: Michael Heerdegen via Users list for the GNU Emacs text editor @ 2024-12-18 12:08 UTC (permalink / raw)
To: help-gnu-emacs
stardiviner <numbchild@gmail.com> writes:
> Yes, it's weird, I'm pretty sure I'm in an normal org-mode
> (major-mode) buffer. Don't know why magit-mode involved.
I think I have been wrong: that the advice is shows up in the backtrace
is normal once you have Magit loaded. It will just fall back to the
original function. This is probably not our culprit.
Ok - but you are using something called `pcre-query-replace-regexp', not
the original `isearch' `query-replace'. My first question would be: can
you reproduce this issue using the vanilla `query-replace'? If not, it
may be a problem in `pcre-query-replace-regexp', some side effect that
interferes with isearch' open-and-close-invisible-areas mechanism.
Michael.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-12-18 12:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16 7:42 isearch replace on org-mode buffer overlays caused error Christopher M. Miles
2024-12-16 10:23 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-18 6:20 ` stardiviner
2024-12-18 12:08 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-12-18 6:21 ` stardiviner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).