From 13b951001c15a78f7f8cb4bff1825cc77b2c8456 Mon Sep 17 00:00:00 2001 From: Robert Pluim Date: Thu, 22 Aug 2019 16:14:26 +0200 Subject: [PATCH 1/3] Add description of chinese-sisheng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * doc/emacs/mule.texi (Input Methods): Add description of chinese-sisheng method for entering characters using pīnyīn. --- doc/emacs/mule.texi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi index b3e7d218c62..4ed13b8787c 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}, do the highlighting in the buffer showing the possible characters, 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 phonetic spelling; then, after the word is in the buffer, Emacs converts it into one or more characters using a large dictionary. One From c596be08f71e8118ddaa3e330997716de4c109ab Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Sat, 7 Sep 2019 18:15:40 +0000 Subject: [PATCH 2/3] Amend the menu caption for page "Display Property" in the Elisp manual. * doc/lispref/display.texi (Emacs Display): Replace a content-free menu caption with one mentioning images, margins and text size. --- doc/lispref/display.texi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index 853f69fa330..55a0a2f9243 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi @@ -25,7 +25,7 @@ that Emacs presents to the user. * Fringes:: Controlling window fringes. * Scroll Bars:: Controlling scroll bars. * Window Dividers:: Separating windows visually. -* Display Property:: Enabling special display features. +* Display Property:: Images, margins, text size, etc. * Images:: Displaying images in Emacs buffers. * Xwidgets:: Displaying native widgets in Emacs buffers. * Buttons:: Adding clickable buttons to Emacs buffers. From 30c4f35a6fc8a6507930923766c3126ac1c2063f Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Mon, 9 Sep 2019 08:21:18 +0200 Subject: [PATCH 3/3] query-replace-regexp undo: Update next-replacement after undo * lisp/replace.el (perform-replace): Rename the local binding to not shadow next-replacement. Update next-replacement after undo (Bug#37287). * test/lisp/replace-tests.el (query-replace-undo-bug37287): Add test. (query-replace-undo-bug37073): Tweak this test. --- lisp/replace.el | 14 ++++++++------ test/lisp/replace-tests.el | 18 +++++++++++++++++- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/lisp/replace.el b/lisp/replace.el index 0ddebb12704..dd24d8ba923 100644 --- a/lisp/replace.el +++ b/lisp/replace.el @@ -2584,7 +2584,7 @@ It must return a string." (num-replacements 0) (nocasify t) ; Undo must preserve case (Bug#31073). search-string - next-replacement) + last-replacement) (while (and (< stack-idx stack-len) stack (or (null replaced) last-was-act-and-show)) @@ -2595,9 +2595,9 @@ It must return a string." ;; Bind swapped values ;; (search-string <--> replacement) 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 - next-replacement-replaced next-replacement + last-replacement-replaced last-replacement last-was-act-and-show nil) (when (and (= stack-idx stack-len) @@ -2619,16 +2619,18 @@ It must return a string." (match-data t (nth 2 elt))) noedit (replace-match-maybe-edit - next-replacement nocasify literal + last-replacement nocasify literal noedit real-match-data backward) replace-count (1- replace-count) real-match-data (save-excursion (goto-char (match-beginning 0)) (if regexp-flag - (looking-at next-replacement) - (looking-at (regexp-quote next-replacement))) + (looking-at last-replacement) + (looking-at (regexp-quote last-replacement))) (match-data t (nth 2 elt)))) + (when regexp-flag + (setq next-replacement (nth 4 elt))) ;; Set replaced nil to keep in loop (when (eq def 'undo-all) (setq replaced nil diff --git a/test/lisp/replace-tests.el b/test/lisp/replace-tests.el index cd08a522e39..2a3f207e47b 100644 --- a/test/lisp/replace-tests.el +++ b/test/lisp/replace-tests.el @@ -463,7 +463,9 @@ Return the last evalled form in BODY." (should (replace-tests-with-undo 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))) ?q (string= input (buffer-string))))) @@ -479,4 +481,18 @@ Return the last evalled form in BODY." ?q (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