diff options
| author | Glenn Morris | 2019-09-15 16:38:23 -0700 |
|---|---|---|
| committer | Glenn Morris | 2019-09-15 16:38:23 -0700 |
| commit | a625ca5c2675a41c5c0d277def6b8cb4f4c4d6db (patch) | |
| tree | 80a22e6d963bd93ba62c6df48e26aec7eecbbfa4 | |
| parent | 211dc01a7bfac81281fa80e45e21157fc0c25b26 (diff) | |
| parent | 30c4f35a6fc8a6507930923766c3126ac1c2063f (diff) | |
| download | emacs-a625ca5c2675a41c5c0d277def6b8cb4f4c4d6db.tar.gz emacs-a625ca5c2675a41c5c0d277def6b8cb4f4c4d6db.zip | |
Merge from origin/emacs-26
30c4f35 (origin/emacs-26) query-replace-regexp undo: Update next-repl...
c596be0 Amend the menu caption for page "Display Property" in the Eli...
13b9510 Add description of chinese-sisheng
| -rw-r--r-- | doc/emacs/mule.texi | 4 | ||||
| -rw-r--r-- | doc/lispref/display.texi | 2 | ||||
| -rw-r--r-- | lisp/replace.el | 14 | ||||
| -rw-r--r-- | test/lisp/replace-tests.el | 18 |
4 files changed, 30 insertions, 8 deletions
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index 6a26667510a..dfd464c827c 100644 --- a/doc/emacs/mule.texi +++ b/doc/emacs/mule.texi | |||
| @@ -497,6 +497,10 @@ one of them selects that alternative. The keys @kbd{C-f}, @kbd{C-b}, | |||
| 497 | do the highlighting in the buffer showing the possible characters, | 497 | do the highlighting in the buffer showing the possible characters, |
| 498 | rather than in the echo area. | 498 | rather than in the echo area. |
| 499 | 499 | ||
| 500 | To enter characters according to the @dfn{pīnyīn} transliteration | ||
| 501 | method instead, use the @code{chinese-sisheng} input method. This is | ||
| 502 | a composition based method, where e.g. @kbd{pi1} results in @samp{pī}. | ||
| 503 | |||
| 500 | In Japanese input methods, first you input a whole word using | 504 | In Japanese input methods, first you input a whole word using |
| 501 | phonetic spelling; then, after the word is in the buffer, Emacs | 505 | phonetic spelling; then, after the word is in the buffer, Emacs |
| 502 | converts it into one or more characters using a large dictionary. One | 506 | converts it into one or more characters using a large dictionary. One |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 428fe9595a6..3c3ee1fc6a4 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -25,7 +25,7 @@ that Emacs presents to the user. | |||
| 25 | * Fringes:: Controlling window fringes. | 25 | * Fringes:: Controlling window fringes. |
| 26 | * Scroll Bars:: Controlling scroll bars. | 26 | * Scroll Bars:: Controlling scroll bars. |
| 27 | * Window Dividers:: Separating windows visually. | 27 | * Window Dividers:: Separating windows visually. |
| 28 | * Display Property:: Enabling special display features. | 28 | * Display Property:: Images, margins, text size, etc. |
| 29 | * Images:: Displaying images in Emacs buffers. | 29 | * Images:: Displaying images in Emacs buffers. |
| 30 | * Xwidgets:: Displaying native widgets in Emacs buffers. | 30 | * Xwidgets:: Displaying native widgets in Emacs buffers. |
| 31 | * Buttons:: Adding clickable buttons to Emacs buffers. | 31 | * Buttons:: Adding clickable buttons to Emacs buffers. |
diff --git a/lisp/replace.el b/lisp/replace.el index ad9be77a79b..a82780fc47e 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -2698,7 +2698,7 @@ characters." | |||
| 2698 | (num-replacements 0) | 2698 | (num-replacements 0) |
| 2699 | (nocasify t) ; Undo must preserve case (Bug#31073). | 2699 | (nocasify t) ; Undo must preserve case (Bug#31073). |
| 2700 | search-string | 2700 | search-string |
| 2701 | next-replacement) | 2701 | last-replacement) |
| 2702 | (while (and (< stack-idx stack-len) | 2702 | (while (and (< stack-idx stack-len) |
| 2703 | stack | 2703 | stack |
| 2704 | (or (null replaced) last-was-act-and-show)) | 2704 | (or (null replaced) last-was-act-and-show)) |
| @@ -2709,9 +2709,9 @@ characters." | |||
| 2709 | ;; Bind swapped values | 2709 | ;; Bind swapped values |
| 2710 | ;; (search-string <--> replacement) | 2710 | ;; (search-string <--> replacement) |
| 2711 | search-string (nth (if replaced 4 3) elt) | 2711 | search-string (nth (if replaced 4 3) elt) |
| 2712 | next-replacement (nth (if replaced 3 4) elt) | 2712 | last-replacement (nth (if replaced 3 4) elt) |
| 2713 | search-string-replaced search-string | 2713 | search-string-replaced search-string |
| 2714 | next-replacement-replaced next-replacement | 2714 | last-replacement-replaced last-replacement |
| 2715 | last-was-act-and-show nil) | 2715 | last-was-act-and-show nil) |
| 2716 | 2716 | ||
| 2717 | (when (and (= stack-idx stack-len) | 2717 | (when (and (= stack-idx stack-len) |
| @@ -2733,16 +2733,18 @@ characters." | |||
| 2733 | (match-data t (nth 2 elt))) | 2733 | (match-data t (nth 2 elt))) |
| 2734 | noedit | 2734 | noedit |
| 2735 | (replace-match-maybe-edit | 2735 | (replace-match-maybe-edit |
| 2736 | next-replacement nocasify literal | 2736 | last-replacement nocasify literal |
| 2737 | noedit real-match-data backward) | 2737 | noedit real-match-data backward) |
| 2738 | replace-count (1- replace-count) | 2738 | replace-count (1- replace-count) |
| 2739 | real-match-data | 2739 | real-match-data |
| 2740 | (save-excursion | 2740 | (save-excursion |
| 2741 | (goto-char (match-beginning 0)) | 2741 | (goto-char (match-beginning 0)) |
| 2742 | (if regexp-flag | 2742 | (if regexp-flag |
| 2743 | (looking-at next-replacement) | 2743 | (looking-at last-replacement) |
| 2744 | (looking-at (regexp-quote next-replacement))) | 2744 | (looking-at (regexp-quote last-replacement))) |
| 2745 | (match-data t (nth 2 elt)))) | 2745 | (match-data t (nth 2 elt)))) |
| 2746 | (when regexp-flag | ||
| 2747 | (setq next-replacement (nth 4 elt))) | ||
| 2746 | ;; Set replaced nil to keep in loop | 2748 | ;; Set replaced nil to keep in loop |
| 2747 | (when (eq def 'undo-all) | 2749 | (when (eq def 'undo-all) |
| 2748 | (setq replaced nil | 2750 | (setq replaced nil |
diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index f7bf2d93658..f42d47c2bfb 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el | |||
| @@ -514,7 +514,9 @@ Return the last evalled form in BODY." | |||
| 514 | (should | 514 | (should |
| 515 | (replace-tests-with-undo | 515 | (replace-tests-with-undo |
| 516 | input "theorem \\([0-9]+\\)" | 516 | input "theorem \\([0-9]+\\)" |
| 517 | "theorem \\\\ref{theo_\\1}" | 517 | '(replace-eval-replacement |
| 518 | replace-quote | ||
| 519 | (format "theorem \\\\ref{theo_%d}" (1+ (string-to-number (match-string 1))))) | ||
| 518 | ((?\s . (1 2)) (?U . (3))) | 520 | ((?\s . (1 2)) (?U . (3))) |
| 519 | ?q | 521 | ?q |
| 520 | (string= input (buffer-string))))) | 522 | (string= input (buffer-string))))) |
| @@ -530,4 +532,18 @@ Return the last evalled form in BODY." | |||
| 530 | ?q | 532 | ?q |
| 531 | (string= expected (buffer-string)))))) | 533 | (string= expected (buffer-string)))))) |
| 532 | 534 | ||
| 535 | (ert-deftest query-replace-undo-bug37287 () | ||
| 536 | "Test for https://debbugs.gnu.org/37287 ." | ||
| 537 | (let ((input "foo-1\nfoo-2\nfoo-3") | ||
| 538 | (expected "foo-2\nfoo-2\nfoo-3")) | ||
| 539 | (should | ||
| 540 | (replace-tests-with-undo | ||
| 541 | input "\\([0-9]\\)" | ||
| 542 | '(replace-eval-replacement | ||
| 543 | replace-quote | ||
| 544 | (format "%d" (1+ (string-to-number (match-string 1))))) | ||
| 545 | ((?\s . (1 2 4)) (?U . (3))) | ||
| 546 | ?q | ||
| 547 | (string= expected (buffer-string)))))) | ||
| 548 | |||
| 533 | ;;; replace-tests.el ends here | 549 | ;;; replace-tests.el ends here |