emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Breakpoint ignored.


From: Eli Zaretskii
Subject: Re: Breakpoint ignored.
Date: Sun, 18 Oct 2009 06:19:00 +0200

> From: Óscar_Fuentes <address@hidden>
> Date: Sun, 18 Oct 2009 04:55:52 +0200
> 
> C-h k á says `self-insert-command' is invoked, wich is a built-in
> function. So I follow the link to the source code to learn that the C
> function is Fself_insert_command, then invoke emacs and set a breakpoint
> on it, but gdb does not stop when a character is typed (and displayed),
> as if no breakpoint was active.
> 
> What I'm missing?

You are probably missing the fact that Emacs tries to optimize the
case of insertion of a single character.  See this part of keyboard.c:

              else if (EQ (Vthis_command, Qself_insert_command)
                       /* Try this optimization only on char keystrokes.  */
                       && NATNUMP (last_command_event)
                       && CHAR_VALID_P (XFASTINT (last_command_event), 0))
                {
                  unsigned int c
                    = translate_char (Vtranslation_table_for_input,
                                      XFASTINT (last_command_event));
                  int value;
                  if (NILP (Vexecuting_kbd_macro)
                      && !EQ (minibuf_window, selected_window))
                    {
                      if (!nonundocount || nonundocount >= 20)
                        {
                          Fundo_boundary ();
                          nonundocount = 0;
                        }
                      nonundocount++;
                    }

                  lose = ((XFASTINT (XWINDOW (selected_window)->last_modified)
                           < MODIFF)
                          || (XFASTINT (XWINDOW 
(selected_window)->last_overlay_modified)
                              < OVERLAY_MODIFF)
                          || (XFASTINT (XWINDOW (selected_window)->last_point)
                              != PT)
                          || MODIFF <= SAVE_MODIFF
                          || windows_or_buffers_changed
                          || !EQ (current_buffer->selective_display, Qnil)
                          || detect_input_pending ()
                          || !NILP (XWINDOW 
(selected_window)->column_number_displayed)
                          || !NILP (Vexecuting_kbd_macro));

                  value = internal_self_insert (c, 0);

                  if (value == 2)
                    nonundocount = 0;

                  frame_make_pointer_invisible ();

                  if (! NILP (Vpost_command_hook))
                    /* Put this before calling adjust_point_for_property
                       so it will only get called once in any case.  */
                    goto directly_done;

                  /* VALUE == 1 when AFTER-CHANGE functions are
                     installed which is the case most of the time
                     because FONT-LOCK installs one.  */
                  if (!lose && !value)
                    direct_output_for_insert (c);
                  goto directly_done;
                }





reply via email to

[Prev in Thread] Current Thread [Next in Thread]