# HG changeset patch # User Miles Bader # Date 1089844964 0 # Node ID 0ef3adf2dcd7b71e32e407feafae3e40a5c8ebe6 # Parent 7e766b87637bd4276023561474a2c23de24ab274 Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-455 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. diff -r 7e766b87637b -r 0ef3adf2dcd7 src/ChangeLog --- a/src/ChangeLog Wed Jul 14 22:25:09 2004 +0000 +++ b/src/ChangeLog Wed Jul 14 22:42:44 2004 +0000 @@ -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 -r 7e766b87637b -r 0ef3adf2dcd7 src/keyboard.c --- a/src/keyboard.c Wed Jul 14 22:25:09 2004 +0000 +++ b/src/keyboard.c Wed Jul 14 22:42:44 2004 +0000 @@ -802,6 +802,21 @@ == 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,