emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plague of dashes in command echo


From: Lőrentey Károly
Subject: Plague of dashes in command echo
Date: Mon, 12 Jul 2004 07:00:12 +0200
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

Start Emacs under X, press C-x and wait until the echo "C-x-" appears
in the echo area.  Now move the mouse over an area with a help-echo
property (like the modeline), and note that each small mouse movement
adds a new bogus dash to the end of the command echo.  The bug is not
limited to the help-echo event; special events like iconify-frame and
make-frame-visible have similar side-effects.

I think this is caused by a simple bug in read_char ("goto retry;"
repeats the echo_dash call, too).  The following patch fixes it for
me in a general way:

address@hidden/emacs--hacks--0--patch-2

--- orig/src/keyboard.c
+++ mod/src/keyboard.c
@@ -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,
2004-07-12  Károly Lőrentey  <address@hidden>

        * keyboard.c (echo_dash): Do nothing if there already is a
          dash at the end of the echo string.

-- 
Károly

reply via email to

[Prev in Thread] Current Thread [Next in Thread]