>From 2b93d2984cfa6ad9a33376a198707ebeb9d851b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Le=20Gouguec?= Date: Wed, 3 Jul 2019 21:29:38 +0200 Subject: [PATCH 4/6] fixup! Dedup dired-aux isolated char searching (Bug#35564) --- lisp/dired-aux.el | 4 ++-- test/lisp/dired-aux-tests.el | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lisp/dired-aux.el b/lisp/dired-aux.el index 32a4988498..75c3a8952a 100644 --- a/lisp/dired-aux.el +++ b/lisp/dired-aux.el @@ -108,8 +108,8 @@ dired--no-subst-prompt (add-face-text-property pos (1+ pos) 'warning nil command)) (concat command "\n" (format-message - (ngettext "Send %d occurence of `%s' as-is to shell?" - "Send %d occurences of `%s' as-is to shell?" + (ngettext "Send %d occurrence of `%s' as-is to shell?" + "Send %d occurrences of `%s' as-is to shell?" (length char-positions)) (length char-positions) (propertize (string (aref command (car char-positions))) diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index 3f4bfffaf6..ff18edddb6 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -118,8 +118,8 @@ dired-test-highlight-metachar "Check that non-isolated meta-characters are highlighted" (let* ((command "sed -r -e 's/oo?/a/' -e 's/oo?/a/' ? `?`") (prompt (dired--no-subst-prompt - command - (dired--need-confirm-positions command "?"))) + (dired--need-confirm-positions command "?") + command)) (result (and (string-match (regexp-quote command) prompt) (match-string 0 prompt)))) (should-not (text-property-not-all 1 14 'face nil result)) @@ -130,8 +130,8 @@ dired-test-highlight-metachar ;; Note that `?` is considered isolated, but `*` is not. (let* ((command "sed -e 's/o*/a/' -e 's/o`*` /a/'") (prompt (dired--no-subst-prompt - command - (dired--need-confirm-positions command "*"))) + (dired--need-confirm-positions command "*") + command)) (result (and (string-match (regexp-quote command) prompt) (match-string 0 prompt)))) (should-not (text-property-not-all 1 10 'face nil result)) -- 2.20.1