changeset 76369:488516b0de0a

(read_minibuf): Bind inhibit-read-only a bit longer so as to handle correctly prompts with read-only property.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 07 Mar 2007 02:13:26 +0000
parents 33f4741e3f74
children 14f1f51f8e2b
files src/ChangeLog src/minibuf.c
diffstat 2 files changed, 33 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/src/ChangeLog	Tue Mar 06 23:43:59 2007 +0000
+++ b/src/ChangeLog	Wed Mar 07 02:13:26 2007 +0000
@@ -1,3 +1,8 @@
+2007-03-07  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* minibuf.c (read_minibuf): Bind inhibit-read-only a bit longer so as
+	to handle correctly prompts with read-only property.
+
 2007-03-06  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* sound.c (wav_play): Check header->data_length to see how much we
@@ -29,8 +34,7 @@
 
 2007-03-02  Stuart D. Herring <herring@lanl.gov>
 
-	* keymap.c (Fkey_binding): Don't consider one-element lists as
-	events.
+	* keymap.c (Fkey_binding): Don't consider one-element lists as events.
 
 2007-03-01  Kenichi Handa  <handa@m17n.org>
 
@@ -59,8 +63,8 @@
 	(x_scroll_bar_create, XTset_vertical_scroll_bar)
 	[USE_TOOLKIT_SCROLL_BARS]: Initialize bar->min_handle.
 
-	* macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]: New
-	member `min_handle'.
+	* macterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS]:
+	New member `min_handle'.
 
 2007-02-23  Kim F. Storm  <storm@cua.dk>
 
@@ -83,11 +87,11 @@
 	(mac_flush_display_optional) [USE_CG_DRAWING]: New function.
 	(x_redisplay_interface) [USE_CG_DRAWING]: Set it as handler for
 	flush_display_optional.
-	[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press): New
-	argument MOUSE_POS.  All uses changed.  Set bar->dragging to
+	[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_press):
+	New argument MOUSE_POS.  All uses changed.  Set bar->dragging to
 	negative integer if scroll bar handle is pressed.
-	[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release): Negative
-	bar->dragging means scroll bar handle is not dragged.
+	[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_release):
+	Negative bar->dragging means scroll bar handle is not dragged.
 	[USE_TOOLKIT_SCROLL_BARS] (x_scroll_bar_handle_drag): Get initial
 	offset of scroll bar handle from negative bar->dragging.
 	(XTread_socket) [USE_TOOLKIT_SCROLL_BARS]: Modifiers for scroll
@@ -122,8 +126,7 @@
 
 	* w32menu.c (current_popup_menu): Make available globally.
 	(menubar_selection_callback): Free menu strings before pushing the
-	menu event into the keyboard buffer.  Remove
-	menu_command_in_progress.
+	menu event into the keyboard buffer.  Remove menu_command_in_progress.
 
 	* w32fns.c (current_popup_menu): Use from w32menu.c.
 	(w32_wnd_proc) [WM_EXITMENULOOP, WM_TIMER]: Use menubar_active
@@ -393,8 +396,8 @@
 
 2007-01-14  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
-	* macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]: Use
-	DisableControl for disabled items.  Set default button to first
+	* macmenu.c (create_and_show_dialog) [TARGET_API_MAC_CARBON]:
+	Use DisableControl for disabled items.  Set default button to first
 	enabled one.  Use icon of application in execution.
 
 2007-01-13  Eli Zaretskii  <eliz@gnu.org>
--- a/src/minibuf.c	Tue Mar 06 23:43:59 2007 +0000
+++ b/src/minibuf.c	Wed Mar 07 02:13:26 2007 +0000
@@ -700,27 +700,27 @@
     specbind (Qinhibit_read_only, Qt);
     specbind (Qinhibit_modification_hooks, Qt);
     Ferase_buffer ();
+
+    if (!NILP (current_buffer->enable_multibyte_characters)
+	&& ! STRING_MULTIBYTE (minibuf_prompt))
+      minibuf_prompt = Fstring_make_multibyte (minibuf_prompt);
+    
+    /* Insert the prompt, record where it ends.  */
+    Finsert (1, &minibuf_prompt);
+    if (PT > BEG)
+      {
+	Fput_text_property (make_number (BEG), make_number (PT),
+			    Qfront_sticky, Qt, Qnil);
+	Fput_text_property (make_number (BEG), make_number (PT),
+			    Qrear_nonsticky, Qt, Qnil);
+	Fput_text_property (make_number (BEG), make_number (PT),
+			    Qfield, Qt, Qnil);
+	Fadd_text_properties (make_number (BEG), make_number (PT),
+			      Vminibuffer_prompt_properties, Qnil);
+      }
     unbind_to (count1, Qnil);
   }
 
-  if (!NILP (current_buffer->enable_multibyte_characters)
-      && ! STRING_MULTIBYTE (minibuf_prompt))
-    minibuf_prompt = Fstring_make_multibyte (minibuf_prompt);
-
-  /* Insert the prompt, record where it ends.  */
-  Finsert (1, &minibuf_prompt);
-  if (PT > BEG)
-    {
-      Fput_text_property (make_number (BEG), make_number (PT),
-			  Qfront_sticky, Qt, Qnil);
-      Fput_text_property (make_number (BEG), make_number (PT),
-			  Qrear_nonsticky, Qt, Qnil);
-      Fput_text_property (make_number (BEG), make_number (PT),
-			  Qfield, Qt, Qnil);
-      Fadd_text_properties (make_number (BEG), make_number (PT),
-			    Vminibuffer_prompt_properties, Qnil);
-    }
-
   minibuf_prompt_width = (int) current_column (); /* iftc */
 
   /* Put in the initial input.  */