unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Plague of dashes in command echo
@ 2004-07-12  5:00 Lőrentey Károly
  2004-07-12 23:58 ` Richard Stallman
  0 siblings, 1 reply; 4+ messages in thread
From: Lőrentey Károly @ 2004-07-12  5:00 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 601 bytes --]

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:

lorentey@elte.hu--2004/emacs--hacks--0--patch-2


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 820 bytes --]

--- 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,

[-- Attachment #3: Type: text/plain, Size: 183 bytes --]


2004-07-12  Károly Lőrentey  <lorentey@elte.hu>

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

-- 
Károly

[-- Attachment #4: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-07-13 22:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-12  5:00 Plague of dashes in command echo Lőrentey Károly
2004-07-12 23:58 ` Richard Stallman
2004-07-13 16:44   ` Lőrentey Károly
2004-07-13 22:15     ` Miles Bader

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).