Subject: Re: bug#64178: replace-regexp ignoring value of org-search-invisible

From: Ihor Radchenko <[email-masked]>
Date: Wed, 21 Jun 2023 10:21:44 +0000

[email-masked] writes:

> Of course. My use case is that I wish specifically to append some text to
> some lines. The way I normally do this would be to search for the regex
> end-of-line ($) and replace with some text. E.g. in order to append the
> word foo to the end of a line I would do one of:
>
> :s/$/ foo/ <RET>
> M-x regexp-replace RET $ RET  foo

Ok. Then, it is not an Org mode bug.

Steps to reproduce:

1. emacs -Q /path/to/new/file.el
2. Insert

(defun test ()
  "This is test")

(defun test2 ()
  "This is test2")

3. M-x outline-minor-mode
4. M-x outline-cycle-buffer
5. Observe

(defun test ()...
(defun test2 ()...

6. M-: (setq search-invisible nil)
7. M-x replace-regexp <RET> $ <RET> foo <RET>
8. M-x outline-show-all
9. Observe

(defun test ()foo
  "This is test")foo
foo
(defun test2 ()foo
  "This is test2")foo

Expect:

(defun test ()foo
  "This is test")

(defun test2 ()foo
  "This is test2")

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>