aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2004-07-14 22:42:44 +0000
committerMiles Bader2004-07-14 22:42:44 +0000
commit366511da44322c6ee74c32948aaa8d3f5625cb01 (patch)
treec139fb1527366aa2586d7c3e202d972f2eb19501 /src
parentc426452f4ca948742cccd00c49cfaa3a3779b23d (diff)
downloademacs-366511da44322c6ee74c32948aaa8d3f5625cb01.tar.gz
emacs-366511da44322c6ee74c32948aaa8d3f5625cb01.zip
Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-455
Bash the dashes 2004-07-14 K,Ba(Broly L,Bu(Brentey <lorentey@elte.hu> * src/keyboard.c (echo_dash): Do nothing if there already is a dash at the end of the echo string.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/keyboard.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index b3a9386da86..e40abdc3daa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12004-07-14 K,Ba(Broly L,Bu(Brentey <lorentey@elte.hu>
2
3 * keyboard.c (echo_dash): Do nothing if there already is a dash
4 at the end of the echo string.
5
12004-07-12 Kim F. Storm <storm@cua.dk> 62004-07-12 Kim F. Storm <storm@cua.dk>
2 7
3 * alloc.c (mark_object): Only look at Lisp_Misc_Save_Value 8 * 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 ()
802 == SCHARS (current_kboard->echo_string)) 802 == SCHARS (current_kboard->echo_string))
803 return; 803 return;
804 804
805 /* Do nothing if we have already put a dash at the end. */
806 if (SCHARS (current_kboard->echo_string) > 1)
807 {
808 Lisp_Object last_char, prev_char, idx;
809
810 idx = make_number (SCHARS (current_kboard->echo_string) - 2);
811 prev_char = Faref (current_kboard->echo_string, idx);
812
813 idx = make_number (SCHARS (current_kboard->echo_string) - 1);
814 last_char = Faref (current_kboard->echo_string, idx);
815
816 if (XINT (last_char) == '-' && XINT (prev_char) != ' ')
817 return;
818 }
819
805 /* Put a dash at the end of the buffer temporarily, 820 /* Put a dash at the end of the buffer temporarily,
806 but make it go away when the next character is added. */ 821 but make it go away when the next character is added. */
807 current_kboard->echo_string = concat2 (current_kboard->echo_string, 822 current_kboard->echo_string = concat2 (current_kboard->echo_string,