From: lorentey@elte.hu (Lőrentey Károly)
Subject: Plague of dashes in command echo
Date: Mon, 12 Jul 2004 07:00:12 +0200 [thread overview]
Message-ID: <lorentey.g.e.devel.87wu19izvn.elte@eris.elte.hu> (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
next reply other threads:[~2004-07-12 5:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-12 5:00 Lőrentey Károly [this message]
2004-07-12 23:58 ` Plague of dashes in command echo Richard Stallman
2004-07-13 16:44 ` Lőrentey Károly
2004-07-13 22:15 ` Miles Bader
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=lorentey.g.e.devel.87wu19izvn.elte@eris.elte.hu \
--to=lorentey@elte.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).