Merge from origin/emacs-26
30c4f35(origin/emacs-26) query-replace-regexp undo: Update next-repl...c596be0Amend the menu caption for page "Display Property" in the Eli...13b9510Add description of chinese-sisheng
This commit is contained in:
commit
a625ca5c26
4 changed files with 30 additions and 8 deletions
|
|
@ -497,6 +497,10 @@ one of them selects that alternative. The keys @kbd{C-f}, @kbd{C-b},
|
||||||
do the highlighting in the buffer showing the possible characters,
|
do the highlighting in the buffer showing the possible characters,
|
||||||
rather than in the echo area.
|
rather than in the echo area.
|
||||||
|
|
||||||
|
To enter characters according to the @dfn{pīnyīn} transliteration
|
||||||
|
method instead, use the @code{chinese-sisheng} input method. This is
|
||||||
|
a composition based method, where e.g. @kbd{pi1} results in @samp{pī}.
|
||||||
|
|
||||||
In Japanese input methods, first you input a whole word using
|
In Japanese input methods, first you input a whole word using
|
||||||
phonetic spelling; then, after the word is in the buffer, Emacs
|
phonetic spelling; then, after the word is in the buffer, Emacs
|
||||||
converts it into one or more characters using a large dictionary. One
|
converts it into one or more characters using a large dictionary. One
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ that Emacs presents to the user.
|
||||||
* Fringes:: Controlling window fringes.
|
* Fringes:: Controlling window fringes.
|
||||||
* Scroll Bars:: Controlling scroll bars.
|
* Scroll Bars:: Controlling scroll bars.
|
||||||
* Window Dividers:: Separating windows visually.
|
* Window Dividers:: Separating windows visually.
|
||||||
* Display Property:: Enabling special display features.
|
* Display Property:: Images, margins, text size, etc.
|
||||||
* Images:: Displaying images in Emacs buffers.
|
* Images:: Displaying images in Emacs buffers.
|
||||||
* Xwidgets:: Displaying native widgets in Emacs buffers.
|
* Xwidgets:: Displaying native widgets in Emacs buffers.
|
||||||
* Buttons:: Adding clickable buttons to Emacs buffers.
|
* Buttons:: Adding clickable buttons to Emacs buffers.
|
||||||
|
|
|
||||||
|
|
@ -2698,7 +2698,7 @@ characters."
|
||||||
(num-replacements 0)
|
(num-replacements 0)
|
||||||
(nocasify t) ; Undo must preserve case (Bug#31073).
|
(nocasify t) ; Undo must preserve case (Bug#31073).
|
||||||
search-string
|
search-string
|
||||||
next-replacement)
|
last-replacement)
|
||||||
(while (and (< stack-idx stack-len)
|
(while (and (< stack-idx stack-len)
|
||||||
stack
|
stack
|
||||||
(or (null replaced) last-was-act-and-show))
|
(or (null replaced) last-was-act-and-show))
|
||||||
|
|
@ -2709,9 +2709,9 @@ characters."
|
||||||
;; Bind swapped values
|
;; Bind swapped values
|
||||||
;; (search-string <--> replacement)
|
;; (search-string <--> replacement)
|
||||||
search-string (nth (if replaced 4 3) elt)
|
search-string (nth (if replaced 4 3) elt)
|
||||||
next-replacement (nth (if replaced 3 4) elt)
|
last-replacement (nth (if replaced 3 4) elt)
|
||||||
search-string-replaced search-string
|
search-string-replaced search-string
|
||||||
next-replacement-replaced next-replacement
|
last-replacement-replaced last-replacement
|
||||||
last-was-act-and-show nil)
|
last-was-act-and-show nil)
|
||||||
|
|
||||||
(when (and (= stack-idx stack-len)
|
(when (and (= stack-idx stack-len)
|
||||||
|
|
@ -2733,16 +2733,18 @@ characters."
|
||||||
(match-data t (nth 2 elt)))
|
(match-data t (nth 2 elt)))
|
||||||
noedit
|
noedit
|
||||||
(replace-match-maybe-edit
|
(replace-match-maybe-edit
|
||||||
next-replacement nocasify literal
|
last-replacement nocasify literal
|
||||||
noedit real-match-data backward)
|
noedit real-match-data backward)
|
||||||
replace-count (1- replace-count)
|
replace-count (1- replace-count)
|
||||||
real-match-data
|
real-match-data
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(goto-char (match-beginning 0))
|
(goto-char (match-beginning 0))
|
||||||
(if regexp-flag
|
(if regexp-flag
|
||||||
(looking-at next-replacement)
|
(looking-at last-replacement)
|
||||||
(looking-at (regexp-quote next-replacement)))
|
(looking-at (regexp-quote last-replacement)))
|
||||||
(match-data t (nth 2 elt))))
|
(match-data t (nth 2 elt))))
|
||||||
|
(when regexp-flag
|
||||||
|
(setq next-replacement (nth 4 elt)))
|
||||||
;; Set replaced nil to keep in loop
|
;; Set replaced nil to keep in loop
|
||||||
(when (eq def 'undo-all)
|
(when (eq def 'undo-all)
|
||||||
(setq replaced nil
|
(setq replaced nil
|
||||||
|
|
|
||||||
|
|
@ -514,7 +514,9 @@ Return the last evalled form in BODY."
|
||||||
(should
|
(should
|
||||||
(replace-tests-with-undo
|
(replace-tests-with-undo
|
||||||
input "theorem \\([0-9]+\\)"
|
input "theorem \\([0-9]+\\)"
|
||||||
"theorem \\\\ref{theo_\\1}"
|
'(replace-eval-replacement
|
||||||
|
replace-quote
|
||||||
|
(format "theorem \\\\ref{theo_%d}" (1+ (string-to-number (match-string 1)))))
|
||||||
((?\s . (1 2)) (?U . (3)))
|
((?\s . (1 2)) (?U . (3)))
|
||||||
?q
|
?q
|
||||||
(string= input (buffer-string)))))
|
(string= input (buffer-string)))))
|
||||||
|
|
@ -530,4 +532,18 @@ Return the last evalled form in BODY."
|
||||||
?q
|
?q
|
||||||
(string= expected (buffer-string))))))
|
(string= expected (buffer-string))))))
|
||||||
|
|
||||||
|
(ert-deftest query-replace-undo-bug37287 ()
|
||||||
|
"Test for https://debbugs.gnu.org/37287 ."
|
||||||
|
(let ((input "foo-1\nfoo-2\nfoo-3")
|
||||||
|
(expected "foo-2\nfoo-2\nfoo-3"))
|
||||||
|
(should
|
||||||
|
(replace-tests-with-undo
|
||||||
|
input "\\([0-9]\\)"
|
||||||
|
'(replace-eval-replacement
|
||||||
|
replace-quote
|
||||||
|
(format "%d" (1+ (string-to-number (match-string 1)))))
|
||||||
|
((?\s . (1 2 4)) (?U . (3)))
|
||||||
|
?q
|
||||||
|
(string= expected (buffer-string))))))
|
||||||
|
|
||||||
;;; replace-tests.el ends here
|
;;; replace-tests.el ends here
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue