]> git.eshelyaron.com Git - emacs.git/commitdiff
Merge from origin/emacs-27
authorGlenn Morris <rgm@gnu.org>
Wed, 6 May 2020 16:28:36 +0000 (09:28 -0700)
committerGlenn Morris <rgm@gnu.org>
Wed, 6 May 2020 16:28:36 +0000 (09:28 -0700)
4b419083f9 Honor search-upper-case
310112fdc7 Fix eww-follow-link on URLs with #target

# Conflicts:
# lisp/fileloop.el

1  2 
lisp/fileloop.el
lisp/net/eww.el

index 8f4911638e9f047c8937b8177a501700e39b9bcd,833bb0401cb84cb43c49e5b750bcfb8cacc1a178..d52e35d886fb055b403570a4b1ebc97734fc16d8
@@@ -193,29 -201,30 +201,34 @@@ operating on the next file and nil othe
  ;;;###autoload
  (defun fileloop-initialize-replace (from to files case-fold &optional delimited)
    "Initialize a new round of query&replace on several files.
 -  FROM is a regexp and TO is the replacement to use.
 -  FILES describes the files, as in `fileloop-initialize'.
 -  CASE-FOLD can be t, nil, or `default':
 -    if it is nil, matching of FROM is case-sensitive.
 -    if it is t, matching of FROM is case-insensitive, except
 -       when `search-upper-case' is non-nil and FROM includes
 -       upper-case letters.
 -    if it is `default', the function uses the value of
 -       `case-fold-search' instead.
 -  DELIMITED if non-nil means replace only word-delimited matches."
 +FROM is a regexp and TO is the replacement to use.
- FILES describes the file, as in `fileloop-initialize'.
- CASE-FOLD can be t, nil, or `default', the latter one meaning to obey
- the default setting of `case-fold-search'.
++FILES describes the files, as in `fileloop-initialize'.
++CASE-FOLD can be t, nil, or `default':
++  if it is nil, matching of FROM is case-sensitive.
++  if it is t, matching of FROM is case-insensitive, except
++     when `search-upper-case' is non-nil and FROM includes
++     upper-case letters.
++  if it is `default', the function uses the value of
++     `case-fold-search' instead.
 +DELIMITED if non-nil means replace only word-delimited matches."
    ;; FIXME: Not sure how the delimited-flag interacts with the regexp-flag in
    ;; `perform-replace', so I just try to mimic the old code.
 -  (fileloop-initialize
 -   files
 -   (lambda ()
 -     (let ((case-fold-search (fileloop--case-fold from 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 ()
 -     (let ((case-fold-search (fileloop--case-fold from case-fold)))
 -       (perform-replace from to t t delimited nil multi-query-replace-map)))))
 +  (let ((mstart (make-hash-table :test 'eq)))
 +    (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 from case-fold)))
 +         (when (re-search-forward from nil t)
 +           ;; When we find a match, save its beginning for
 +           ;; `perform-replace' (we used to just set point, but this
 +           ;; is unreliable in the face of
 +           ;; `switch-to-buffer-preserve-window-point').
 +           (puthash (current-buffer) (match-beginning 0) mstart))))
 +     (lambda ()
-        (perform-replace from to t t delimited nil multi-query-replace-map
-                         (gethash (current-buffer) mstart (point-min))
-                         (point-max))))))
++       (let ((case-fold-search (fileloop--case-fold from case-fold)))
++         (perform-replace from to t t delimited nil multi-query-replace-map
++                          (gethash (current-buffer) mstart (point-min))
++                          (point-max)))))))
  
  (provide 'fileloop)
  ;;; fileloop.el ends here
diff --cc lisp/net/eww.el
Simple merge