From 366511da44322c6ee74c32948aaa8d3f5625cb01 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Wed, 14 Jul 2004 22:42:44 +0000 Subject: [PATCH] Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-455 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Bash the dashes 2004-07-14 K,Ba(Broly L,Bu(Brentey * src/keyboard.c (echo_dash): Do nothing if there already is a dash at the end of the echo string. --- src/ChangeLog | 5 +++++ src/keyboard.c | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index b3a9386da86..e40abdc3daa 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2004-07-14 K,Ba(Broly L,Bu(Brentey + + * keyboard.c (echo_dash): Do nothing if there already is a dash + at the end of the echo string. + 2004-07-12 Kim F. Storm * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value diff --git a/src/keyboard.c b/src/keyboard.c index f016a1283e4..89706dc3dce 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -802,6 +802,21 @@ echo_dash () == SCHARS (current_kboard->echo_string)) return; + /* Do nothing if we have already put a dash at the end. */ + if (SCHARS (current_kboard->echo_string) > 1) + { + Lisp_Object last_char, prev_char, idx; + + idx = make_number (SCHARS (current_kboard->echo_string) - 2); + prev_char = Faref (current_kboard->echo_string, idx); + + idx = make_number (SCHARS (current_kboard->echo_string) - 1); + last_char = Faref (current_kboard->echo_string, idx); + + if (XINT (last_char) == '-' && XINT (prev_char) != ' ') + return; + } + /* Put a dash at the end of the buffer temporarily, but make it go away when the next character is added. */ current_kboard->echo_string = concat2 (current_kboard->echo_string, -- 2.39.2