From 91d4898d5cceddd80456b6ce57ce2c5392aa1281 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 19 Apr 2022 13:48:06 +0200 Subject: [PATCH 1/2] Revert prompting changes in viper-cmd * lisp/emulation/viper-cmd.el (viper-quote-region) (viper-read-string-with-history, viper-query-replace): Revert prompting changes done in 50512e3 -- the way viper prompts in command mode is special (bug#55007). Do not merge to master. --- lisp/emulation/viper-cmd.el | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el index 2740a5b3e50..1f2f3ecfc38 100644 --- a/lisp/emulation/viper-cmd.el +++ b/lisp/emulation/viper-cmd.el @@ -1786,7 +1786,7 @@ Undo previous insertion and inserts new." (do-not-change-default t)) (setq quote-str (viper-read-string-with-history - "Quote string" + "Quote string: " nil 'viper-quote-region-history ;; FIXME: Use comment-region. @@ -1995,17 +1995,24 @@ problems." #'viper-minibuffer-standard-hook (if (or (not (listp old)) (eq (car old) 'lambda)) (list old) old)))) - (val "")) + (val "") + (padding "") + temp-msg) (setq keymap (or keymap minibuffer-local-map) initial (or initial "") - viper-initial initial) + viper-initial initial + temp-msg (if default + (format "(default %s) " default) + "")) (setq viper-incomplete-ex-cmd nil) - (setq val (read-from-minibuffer (format-prompt prompt default) - nil - keymap nil history-var default)) - (setq minibuffer-setup-hook nil) + (setq val (read-from-minibuffer prompt + (concat temp-msg initial val padding) + keymap nil history-var)) + (setq minibuffer-setup-hook nil + padding (viper-array-to-string (this-command-keys)) + temp-msg "") ;; the following tries to be smart about what to put in history (if (not (string= val (car (symbol-value history-var)))) (push val (symbol-value history-var))) @@ -3819,7 +3826,7 @@ Null string will repeat previous search." (let (buffer buffer-name) (setq buffer-name (funcall viper-read-buffer-function - (format-prompt "Kill buffer" + (format "Kill buffer (%s): " (buffer-name (current-buffer))))) (setq buffer (if (null buffer-name) @@ -4165,8 +4172,8 @@ and regexp replace." (interactive) (let (str) (setq str (viper-read-string-with-history - (if viper-re-query-replace "Query replace regexp" - "Query replace") + (if viper-re-query-replace "Query replace regexp: " + "Query replace: ") nil ; no initial 'viper-replace1-history (car viper-replace1-history) ; default @@ -4181,7 +4188,7 @@ and regexp replace." (query-replace-regexp str (viper-read-string-with-history - (format-message "Query replace regexp `%s' with" str) + (format-message "Query replace regexp `%s' with: " str) nil ; no initial 'viper-replace1-history (car viper-replace1-history) ; default @@ -4189,7 +4196,7 @@ and regexp replace." (query-replace str (viper-read-string-with-history - (format-message "Query replace `%s' with" str) + (format-message "Query replace `%s' with: " str) nil ; no initial 'viper-replace1-history (car viper-replace1-history) ; default From e6c2a2497d8cc8c38c816507681d5d529cfdbf2e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 19 Apr 2022 19:16:29 -0700 Subject: [PATCH 2/2] Update from gnulib (cherry picked from commit 992cf3cb675e074079341cc54c3b16d37a8b9ca8) This is a partial backport from master: it only includes the changes below. * lib/mini-gmp.c (gmp_assert_nocarry): Avoid many Clang unused-variable warnings when building with optimisation. * lib/verify.h (_GL_HAVE__STATIC_ASSERT): Modify condition for using _Static_assert to cope with older Apple builds of Clang exposing misleading compiler version numbers. See discussion starting at https://lists.gnu.org/archive/html/emacs-devel/2022-04/msg00779.html --- lib/mini-gmp.c | 1 + lib/verify.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/mini-gmp.c b/lib/mini-gmp.c index 8577b59ef6d..14cabd12311 100644 --- a/lib/mini-gmp.c +++ b/lib/mini-gmp.c @@ -90,6 +90,7 @@ see https://www.gnu.org/licenses/. */ #define gmp_assert_nocarry(x) do { \ mp_limb_t __cy = (x); \ assert (__cy == 0); \ + (void) (__cy); \ } while (0) #define gmp_clz(count, x) do { \ diff --git a/lib/verify.h b/lib/verify.h index 07b2f4866f2..c2d2a566706 100644 --- a/lib/verify.h +++ b/lib/verify.h @@ -34,7 +34,7 @@ #ifndef __cplusplus # if (201112L <= __STDC_VERSION__ \ || (!defined __STRICT_ANSI__ \ - && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 4 <= __clang_major__))) + && (4 < __GNUC__ + (6 <= __GNUC_MINOR__) || 5 <= __clang_major__))) # define _GL_HAVE__STATIC_ASSERT 1 # endif # if (202000L <= __STDC_VERSION__ \