all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: simenheg@runbox.com, monnier@IRO.UMontreal.CA, 40940@debbugs.gnu.org
Subject: bug#40940: 27.0.91; project-query-replace-regexp stops too early
Date: Wed, 29 Apr 2020 23:53:46 +0300	[thread overview]
Message-ID: <32c0b31e-9165-faff-c9a0-9103d937898b@yandex.ru> (raw)
In-Reply-To: <83mu6uzi8h.fsf@gnu.org>

On 29.04.2020 13:41, Eli Zaretskii wrote:
> The patch below seems to fix the rest.  Note that I've decided to make
> the change in fileloop.el, since I think all the other callers need
> the same fix.

Naturally.

> Also, using downcase is not entirely correct, we should
> use isearch-no-upper-case-p instead.

I usually like isearch-no-upper-case-p behavior, but here it doesn't fit 
the docstring, does it? There is no value of CASE-FOLD described that 
would indicate that the function will be too smart about it.

So we'd need to update the docstring that the CASE-FOLD value of t will 
obey the value of `search-upper-case'. Then we'll consult it as well, 
like isearch-search does.

Alternatively, we could for now use the below patch which changes the 
behavior less:

diff --git a/lisp/fileloop.el b/lisp/fileloop.el
index 543963feaf..c3c55badf5 100644
--- a/lisp/fileloop.el
+++ b/lisp/fileloop.el
@@ -175,14 +175,16 @@ fileloop-continue
              (funcall fileloop--operate-function)))
        (setq file-finished t))))

+(defun fileloop--case-fold (arg)
+  (if (memq arg '(t nil)) arg case-fold-search))
+
  ;;;###autoload
  (defun fileloop-initialize-search (regexp files case-fold)
    (let ((last-buffer (current-buffer)))
      (fileloop-initialize
       files
       (lambda ()
-       (let ((case-fold-search
-              (if (memq case-fold '(t nil)) case-fold case-fold-search)))
+       (let ((case-fold-search (fileloop--case-fold case-fold)))
           (re-search-forward regexp nil t)))
       (lambda ()
         (unless (eq last-buffer (current-buffer))
@@ -203,15 +205,16 @@ fileloop-initialize-replace
    (fileloop-initialize
     files
     (lambda ()
-     (let ((case-fold-search
-            (if (memql case-fold '(nil t)) case-fold case-fold-search)))
+     (let ((case-fold-search (fileloop--case-fold case-fold)))
         (if (re-search-forward from nil t)
  	   ;; When we find a match, move back
  	   ;; to the beginning of it so perform-replace
  	   ;; will see it.
  	   (goto-char (match-beginning 0)))))
     (lambda ()
-     (perform-replace from to t t delimited nil multi-query-replace-map))))
+     (let ((case-fold-search (fileloop--case-fold case-fold))
+           search-upper-case)
+       (perform-replace from to t t delimited nil 
multi-query-replace-map)))))

  (provide 'fileloop)
  ;;; fileloop.el ends here





  reply	other threads:[~2020-04-29 20:53 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-28 14:35 bug#40940: 27.0.91; project-query-replace-regexp stops too early Simen Heggestøyl
2020-04-29  3:54 ` Dmitry Gutov
2020-04-29  7:35   ` Eli Zaretskii
2020-04-29  8:29     ` Simen Heggestøyl
2020-04-29  8:37       ` Eli Zaretskii
2020-04-29  9:24         ` Eli Zaretskii
2020-04-29 10:41           ` Eli Zaretskii
2020-04-29 20:53             ` Dmitry Gutov [this message]
2020-04-30 20:16               ` Juri Linkov
2020-05-01  6:00                 ` Eli Zaretskii
2020-05-01  6:57               ` Eli Zaretskii
2020-05-01 15:27                 ` Dmitry Gutov
2020-05-01 15:45                   ` Eli Zaretskii
2020-05-01 23:21                     ` Dmitry Gutov
2020-05-02  6:44                       ` Eli Zaretskii
2020-05-02  7:56                         ` Eli Zaretskii
2020-05-03  1:43                         ` Dmitry Gutov
2020-05-03  6:54                           ` Simen Heggestøyl
2020-05-03 17:10                           ` Eli Zaretskii
2020-05-03 17:28                             ` Dmitry Gutov
2020-05-03 23:58                               ` Dmitry Gutov
2020-04-29 14:50           ` Dmitry Gutov
2020-04-29 14:59             ` Eli Zaretskii
2020-04-29 15:42               ` Dmitry Gutov
2020-04-29 16:04                 ` Eli Zaretskii
2020-04-29 16:11                   ` Dmitry Gutov
2020-04-29 15:49               ` Michael Albinus
2020-04-29 15:58                 ` Dmitry Gutov
2020-04-29 16:10                 ` Eli Zaretskii
2020-04-29 16:22                   ` Michael Albinus
2020-04-29 16:44                     ` Eli Zaretskii
2020-04-29 18:20                       ` Dmitry Gutov
2020-04-29 18:38                         ` Michael Albinus
2020-04-29 19:09                           ` Dmitry Gutov
2020-04-29 19:15                             ` Michael Albinus
2020-04-29 19:26                             ` Eli Zaretskii
2020-04-29 18:44                         ` Eli Zaretskii
2020-04-29 18:56                           ` Michael Albinus

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=32c0b31e-9165-faff-c9a0-9103d937898b@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=40940@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=simenheg@runbox.com \
    /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.