changeset 37864:db3e294b4ce2

*** empty log message ***
author Gerd Moellmann <gerd@gnu.org>
date Tue, 29 May 2001 11:10:47 +0000
parents 26de49e18fd7
children f709fd47bebd
files src/ChangeLog src/editfns.c src/indent.c src/keymap.c src/lread.c src/macros.c src/termcap.c src/xmenu.c src/xterm.c
diffstat 9 files changed, 96 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue May 29 08:56:24 2001 +0000
+++ b/src/ChangeLog	Tue May 29 11:10:47 2001 +0000
@@ -1,4 +1,4 @@
-2001-05-21  Gerd Moellmann  <gerd@gnu.org>
+2001-05-29  Gerd Moellmann  <gerd@gnu.org>
 
 	* lisp.h (enum symbol_interned): New enumeration.
 	(struct Lisp_Symbol): Remove member `obarray', add
@@ -44,6 +44,29 @@
 	SET_SYMBOL_VALUE macros instead of accessing symbols' value
 	directly.
 
+2001-05-28  Gerd Moellmann  <gerd@gnu.org>
+
+	* xmenu.c (xmenu_show) [!HAVE_MULTILINGUAL_MENU]: Don't overwrite 
+	an item's name with its key description in case the description
+	is a multibyte string.
+
+	* keymap.c (Fsingle_key_description): Create a multibyte string
+	only if necessary.
+
+	* macros.c (Fstart_kbd_macro): Doc fix.
+
+	* xterm.c (cursor_in_mouse_face_p): New function.
+	(x_draw_stretch_glyph_string): Use it to choose a different GC
+	when drawing a cursor within highlighted text.
+
+	* editfns.c (char_property_eq): Put in #if 0.
+
+	* indent.c (string_display_width): Put in #if 0.
+
+	* lread.c (Fload): Remove unused label.
+
+	* termcap.c (speeds): Put in #if 0.
+
 2001-05-18  Gerd Moellmann  <gerd@gnu.org>
 
 	* eval.c (call_debugger): Don't bind inhibit-eval-during-redisplay.
--- a/src/editfns.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/editfns.c	Tue May 29 11:10:47 2001 +0000
@@ -316,6 +316,8 @@
 }
 
 
+#if 0 /* Not used.  */
+
 /* Return nonzero if POS1 and POS2 have the same value
    for the text property PROP.  */
 
@@ -332,6 +334,8 @@
   return EQ (pval1, pval2);
 }
 
+#endif /* 0 */
+
 /* Return the direction from which the text-property PROP would be
    inherited by any new text inserted at POS: 1 if it would be
    inherited from the char after POS, -1 if it would be inherited from
--- a/src/indent.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/indent.c	Tue May 29 11:10:47 2001 +0000
@@ -624,6 +624,9 @@
   return col;
 }
 
+
+#if 0 /* Not used.  */
+
 /* Return the width in columns of the part of STRING from BEG to END.
    If BEG is nil, that stands for the beginning of STRING.
    If END is nil, that stands for the end of STRING.  */
@@ -701,6 +704,9 @@
 
   return col;
 }
+
+#endif /* 0 */
+
 
 DEFUN ("indent-to", Findent_to, Sindent_to, 1, 2, "NIndent to column: ",
   "Indent from point with tabs and spaces until COLUMN is reached.\n\
--- a/src/keymap.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/keymap.c	Tue May 29 11:10:47 2001 +0000
@@ -1959,14 +1959,18 @@
 	}
       else
 	{
-	  char tem[KEY_DESCRIPTION_SIZE];
-	  int len;
-
-	  *push_key_description (XUINT (key), tem, 1) = 0;
-	  len = strlen (tem);
-	  return make_multibyte_string (tem,
-					multibyte_chars_in_text (tem, len),
-					len);
+	  char tem[KEY_DESCRIPTION_SIZE], *end;
+	  int nbytes, nchars;
+	  Lisp_Object string;
+
+	  end = push_key_description (XUINT (key), tem, 1);
+	  nbytes = end - tem;
+	  nchars = multibyte_chars_in_text (tem, nbytes);
+	  if (nchars == nbytes)
+	    string = build_string (tem);
+	  else
+	    string = make_multibyte_string (tem, nchars, nbytes);
+	  return string;
 	}
     }
   else if (SYMBOLP (key))	/* Function key or event-symbol */
--- a/src/lread.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/lread.c	Tue May 29 11:10:47 2001 +0000
@@ -777,8 +777,6 @@
     }
   else
     {
-    load_source:
-
       /* We are loading a source file (*.el).  */
       if (!NILP (Vload_source_file_function))
 	{
--- a/src/macros.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/macros.c	Tue May 29 11:10:47 2001 +0000
@@ -61,7 +61,7 @@
 Use \\[end-kbd-macro] to finish recording and make the macro available.\n\
 Use \\[name-last-kbd-macro] to give it a permanent name.\n\
 Non-nil arg (prefix arg) means append to last macro defined;\n\
- This begins by re-executing that macro as if you typed it again.")
+this begins by re-executing that macro as if you typed it again.")
   (append)
      Lisp_Object append;
 {
--- a/src/termcap.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/termcap.c	Tue May 29 11:10:47 2001 +0000
@@ -1,5 +1,6 @@
 /* Work-alike for termcap, plus extra features.
-   Copyright (C) 1985, 86, 93, 94, 95, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1985, 86, 93, 94, 95, 2000, 2001
+   Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -292,6 +293,8 @@
 int tputs_baud_rate;
 char PC;
 
+#if 0 /* Doesn't seem to be used anymore.  */
+
 /* Actual baud rate if positive;
    - baud rate / 100 if negative.  */
 
@@ -306,6 +309,8 @@
 #endif /* not VMS */
   };
 
+#endif /* 0  */
+
 void
 tputs (str, nlines, outfun)
      register char *str;
--- a/src/xmenu.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/xmenu.c	Tue May 29 11:10:47 2001 +0000
@@ -2077,7 +2077,7 @@
           if (STRINGP (item_name) && STRING_MULTIBYTE (item_name))
             item_name = string_make_unibyte (item_name);
           if (STRINGP (descrip) && STRING_MULTIBYTE (descrip))
-            item_name = string_make_unibyte (descrip);
+            descrip = string_make_unibyte (descrip);
 #endif
  
 	  wv = xmalloc_widget_value ();
--- a/src/xterm.c	Tue May 29 08:56:24 2001 +0000
+++ b/src/xterm.c	Tue May 29 11:10:47 2001 +0000
@@ -399,6 +399,7 @@
   DRAW_IMAGE_SUNKEN
 };
 
+static int cursor_in_mouse_face_p P_ ((struct window *));
 static int clear_mouse_face P_ ((struct x_display_info *));
 static int x_alloc_nearest_color_1 P_ ((Display *, Colormap, XColor *));
 static void x_set_window_size_1 P_ ((struct frame *, int, int, int));
@@ -4384,14 +4385,23 @@
       /* Clear rest using the GC of the original non-cursor face.  */
       if (width < s->background_width)
 	{
-	  GC gc = s->face->gc;
 	  int x = s->x + width, y = s->y;
 	  int w = s->background_width - width, h = s->height;
 	  XRectangle r;
-
+	  GC gc;
+
+	  if (s->row->mouse_face_p
+	      && cursor_in_mouse_face_p (s->w))
+	    {
+	      x_set_mouse_face_gc (s);
+	      gc = s->gc;
+	    }
+	  else
+	    gc = s->face->gc;
+  
 	  x_get_glyph_string_clip_rect (s, &r);
 	  XSetClipRectangles (s->display, gc, 0, 0, &r, 1, Unsorted);
-
+	  
 	  if (s->face->stipple)
 	    {
 	      /* Fill background with a stipple pattern.  */
@@ -11201,6 +11211,35 @@
 }
 
 
+/* Non-zero if physical cursor of window W is within mouse face.  */
+
+static int
+cursor_in_mouse_face_p (w)
+     struct window *w;
+{
+  struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (XFRAME (w->frame));
+  int in_mouse_face = 0;
+  
+  if (WINDOWP (dpyinfo->mouse_face_window)
+      && XWINDOW (dpyinfo->mouse_face_window) == w)
+    {
+      int hpos = w->phys_cursor.hpos;
+      int vpos = w->phys_cursor.vpos;
+
+      if (vpos >= dpyinfo->mouse_face_beg_row
+	  && vpos <= dpyinfo->mouse_face_end_row
+	  && (vpos > dpyinfo->mouse_face_beg_row
+	      || hpos >= dpyinfo->mouse_face_beg_col)
+	  && (vpos < dpyinfo->mouse_face_end_row
+	      || hpos < dpyinfo->mouse_face_end_col
+	      || dpyinfo->mouse_face_past_end))
+	in_mouse_face = 1;
+    }
+
+  return in_mouse_face;
+}
+
+
 /* Display or clear cursor of window W.  If ON is zero, clear the
    cursor.  If it is non-zero, display the cursor.  If ON is nonzero,
    where to put the cursor is specified by HPOS, VPOS, X and Y.  */