unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Unwanted undo-boundary
@ 2010-02-13 13:56 Lennart Borgman
       [not found] ` <jwv3a15nf3k.fsf-monnier+emacs@gnu.org>
  0 siblings, 1 reply; 11+ messages in thread
From: Lennart Borgman @ 2010-02-13 13:56 UTC (permalink / raw)
  To: Emacs-Devel devel; +Cc: Johan Andersson

I just got a bug report saying that a single indent-region in mumamo
can't be undone with a single undo command. (This is with the latest
nXhtml beta and I can confirm it with an Emacs from 2010-02-03.)

I assume this means that something is calling undo-boundary, but I
can't find out what. There is nothing in nXhtml that does it. (Yes,
one function does, but it is not involved here.) I tried to trace
undo-boundary, but I get no hit.

Does anyone have a good idea for how to find out what is happening? Am
I wrong assuming that undo-boundary have been called (implicitly or
explicitly)?




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
       [not found] ` <jwv3a15nf3k.fsf-monnier+emacs@gnu.org>
@ 2010-02-14  0:30   ` Lennart Borgman
  2010-02-14  4:14     ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Lennart Borgman @ 2010-02-14  0:30 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Johan Andersson, Emacs-Devel devel

On Sat, Feb 13, 2010 at 7:54 PM, Stefan Monnier
<monnier@iro.umontreal.ca> wrote:
>> I just got a bug report saying that a single indent-region in mumamo
>> can't be undone with a single undo command. (This is with the latest
>> nXhtml beta and I can confirm it with an Emacs from 2010-02-03.)
>
>> I assume this means that something is calling undo-boundary, but I
>> can't find out what. There is nothing in nXhtml that does it. (Yes,
>> one function does, but it is not involved here.) I tried to trace
>> undo-boundary, but I get no hit.
>
>> Does anyone have a good idea for how to find out what is happening? Am
>> I wrong assuming that undo-boundary have been called (implicitly or
>> explicitly)?
>
> It's hard to tell without more info, but yes if more than a single undo
> is needed, it's probably because of a call to undo-boundary, tho it
> might come from the C code (which you wouldn't be able to trace from
> Elisp, you'd need to put a breakpoint on Fundo_boundary from gdb).


I have not done that (yet), but looking at the where Fundo_boundary is
called I see that there is a check like this

 if (current_buffer != last_undo_buffer)
    Fundo_boundary ();
  last_undo_buffer = current_buffer;

in some places. In my case changes in two buffers are involved. (One
is just to figure out the indentation.)


I just did a fresh checkout and tried "gdb emacs" but got:

  .gdbinit:23: Error in sourced command file:
  No symbol table is loaded.  Use the "file" command.

Is this expected? For configure I have used (on w32):

    cmd /c configure --with-gcc --no-opt --cflags -Ic:/g/include
--cflags -fno-crossjumping



> Maybe if you look at the place where the undo stops, you'll get some
> hint at the culprit,
>
>
>        Stefan
>




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14  0:30   ` Lennart Borgman
@ 2010-02-14  4:14     ` Eli Zaretskii
  2010-02-14  8:20       ` Lennart Borgman
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2010-02-14  4:14 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: monnier, johan.rejeep, emacs-devel

> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Sun, 14 Feb 2010 01:30:21 +0100
> Cc: Johan Andersson <johan.rejeep@gmail.com>,
> 	Emacs-Devel devel <emacs-devel@gnu.org>
> 
> I just did a fresh checkout and tried "gdb emacs" but got:
> 
>   .gdbinit:23: Error in sourced command file:
>   No symbol table is loaded.  Use the "file" command.
> 
> Is this expected?

No.  Does it help to say "gdb emacs.exe" instead?  (Btw, I assume you
actually did something like "gdb /path/to/emacs.exe", like, for
example, "gdb ./oo-spd/i386/emacs", because normally emacs.exe is not
in the src subdirectory, where you find .gdbinit.)




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14  4:14     ` Eli Zaretskii
@ 2010-02-14  8:20       ` Lennart Borgman
  2010-02-14 18:03         ` Eli Zaretskii
  0 siblings, 1 reply; 11+ messages in thread
From: Lennart Borgman @ 2010-02-14  8:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: monnier, johan.rejeep, emacs-devel

On Sun, Feb 14, 2010 at 5:14 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Lennart Borgman <lennart.borgman@gmail.com>
>> Date: Sun, 14 Feb 2010 01:30:21 +0100
>> Cc: Johan Andersson <johan.rejeep@gmail.com>,
>>       Emacs-Devel devel <emacs-devel@gnu.org>
>>
>> I just did a fresh checkout and tried "gdb emacs" but got:
>>
>>   .gdbinit:23: Error in sourced command file:
>>   No symbol table is loaded.  Use the "file" command.
>>
>> Is this expected?
>
> No.  Does it help to say "gdb emacs.exe" instead?  (Btw, I assume you
> actually did something like "gdb /path/to/emacs.exe", like, for
> example, "gdb ./oo-spd/i386/emacs", because normally emacs.exe is not
> in the src subdirectory, where you find .gdbinit.)

No, I just did what etc/DEBUG says which is

   dbg emacs

Since I do these things so seldom I am dependent on that this is correct.

I just tried

   dbg PATH-TO/emacs.exe

and got

   GNU gdb 5.2.1
   Copyright 2002 Free Software Foundation, Inc.
   GDB is free software, covered by the GNU General Public License, and you are
   welcome to change it and/or distribute copies of it under certain conditions.
   Type "show copying" to see the conditions.
   There is absolutely no warranty for GDB.  Type "show warranty" for details.
   This GDB was configured as
"i686-pc-mingw32"...c:/cygmnt/prj/pkg/src/gdb/mingw32/gdb/dwarf2read.c:985:
gdb-internal-error: read_comp_unit_head: dwarf from non elf file

   An internal GDB error was detected.  This may make further
   debugging unreliable.  Quit this debugging session? (y or n)




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14  8:20       ` Lennart Borgman
@ 2010-02-14 18:03         ` Eli Zaretskii
  2010-02-14 21:31           ` Lennart Borgman
  0 siblings, 1 reply; 11+ messages in thread
From: Eli Zaretskii @ 2010-02-14 18:03 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: emacs-devel

>    GNU gdb 5.2.1
>    Copyright 2002 Free Software Foundation, Inc.
>    GDB is free software, covered by the GNU General Public License, and you are
>    welcome to change it and/or distribute copies of it under certain conditions.
>    Type "show copying" to see the conditions.
>    There is absolutely no warranty for GDB.  Type "show warranty" for details.
>    This GDB was configured as
> "i686-pc-mingw32"...c:/cygmnt/prj/pkg/src/gdb/mingw32/gdb/dwarf2read.c:985:
> gdb-internal-error: read_comp_unit_head: dwarf from non elf file
> 
>    An internal GDB error was detected.  This may make further
>    debugging unreliable.  Quit this debugging session? (y or n)

Get a newer port of GDB.  Evidently, the one you have does not support
DWARF-2 debug info on Windows.  You can find GDB 7.0 on the MinGW
site.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14 18:03         ` Eli Zaretskii
@ 2010-02-14 21:31           ` Lennart Borgman
  2010-02-14 22:32             ` Lennart Borgman
  2010-02-15  3:56             ` Eli Zaretskii
  0 siblings, 2 replies; 11+ messages in thread
From: Lennart Borgman @ 2010-02-14 21:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Sun, Feb 14, 2010 at 7:03 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>    GNU gdb 5.2.1
>>    Copyright 2002 Free Software Foundation, Inc.
>>    GDB is free software, covered by the GNU General Public License, and you are
>>    welcome to change it and/or distribute copies of it under certain conditions.
>>    Type "show copying" to see the conditions.
>>    There is absolutely no warranty for GDB.  Type "show warranty" for details.
>>    This GDB was configured as
>> "i686-pc-mingw32"...c:/cygmnt/prj/pkg/src/gdb/mingw32/gdb/dwarf2read.c:985:
>> gdb-internal-error: read_comp_unit_head: dwarf from non elf file
>>
>>    An internal GDB error was detected.  This may make further
>>    debugging unreliable.  Quit this debugging session? (y or n)
>
> Get a newer port of GDB.  Evidently, the one you have does not support
> DWARF-2 debug info on Windows.  You can find GDB 7.0 on the MinGW
> site.

Thanks Eli, worked much better. (Are you following gdb development
since you knew what DWARF-2 debug info is?)




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14 21:31           ` Lennart Borgman
@ 2010-02-14 22:32             ` Lennart Borgman
  2010-02-14 22:49               ` Lennart Borgman
  2010-02-15  3:57               ` Eli Zaretskii
  2010-02-15  3:56             ` Eli Zaretskii
  1 sibling, 2 replies; 11+ messages in thread
From: Lennart Borgman @ 2010-02-14 22:32 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: emacs-devel

On Sun, Feb 14, 2010 at 10:31 PM, Lennart Borgman
<lennart.borgman@gmail.com> wrote:
> On Sun, Feb 14, 2010 at 7:03 PM, Eli Zaretskii <eliz@gnu.org> wrote:
>>>    GNU gdb 5.2.1
>>>    Copyright 2002 Free Software Foundation, Inc.
>>>    GDB is free software, covered by the GNU General Public License, and you are
>>>    welcome to change it and/or distribute copies of it under certain conditions.
>>>    Type "show copying" to see the conditions.
>>>    There is absolutely no warranty for GDB.  Type "show warranty" for details.
>>>    This GDB was configured as
>>> "i686-pc-mingw32"...c:/cygmnt/prj/pkg/src/gdb/mingw32/gdb/dwarf2read.c:985:
>>> gdb-internal-error: read_comp_unit_head: dwarf from non elf file
>>>
>>>    An internal GDB error was detected.  This may make further
>>>    debugging unreliable.  Quit this debugging session? (y or n)
>>
>> Get a newer port of GDB.  Evidently, the one you have does not support
>> DWARF-2 debug info on Windows.  You can find GDB 7.0 on the MinGW
>> site.
>
> Thanks Eli, worked much better. (Are you following gdb development
> since you knew what DWARF-2 debug info is?)


Looks like I need some more hand-helding. I put a breakpoint here

    (gdb) b Fundo_boundary

and executed in Emacs

    M-: (indent-region 1 (point-max))

and then called xbacktrace at each stop at Fundo_boundary. There were
five lines in the region and on each of them Fundo_boundary was called
but I do not understand how. I thought xbacktrace should give me
information about it, but it does not seem to do that as far as I can
see. So I guess I have to call bt instead, or?

The xbacktrace:s are here, just in case I misunderstand this:

    Breakpoint 3, Fundo_boundary () at undo.c:303
    303       if (EQ (current_buffer->undo_list, Qt))
    (gdb) xbacktrace
    "nxml-indent-line" (0x82d7b4)
    "funcall" (0x82d7b0)
    "let" (0x82da60)
    "save-restriction" (0x82dbc0)
    "let" (0x82dd90)
    "if" (0x82df10)
    "mumamo-call-indent-line" (0x82dfc0)
    "progn" (0x82e270)
    "if" (0x82e3b0)
    "cond" (0x82e530)
    "let*" (0x82e6e0)
    "mumamo-indent-line-function-1" (0x82e790)
    "let" (0x82ea90)
    "or" (0x82ebd0)
    "while" (0x82ed70)
    "let" (0x82ef60)
    "save-excursion" (0x82f0c0)
    "mumamo-indent-region-function" (0x82f204)
    "indent-region" (0x82f3a0)
    "eval" (0x82f5d4)
    "eval-expression" (0x82f814)
    "call-interactively" (0x82fb44)
    (gdb) c
    Continuing.

    Breakpoint 3, Fundo_boundary () at undo.c:303
    303       if (EQ (current_buffer->undo_list, Qt))
    (gdb) xbacktrace
    "indent-line-to" (0x82e040)
    "progn" (0x82e2f0)
    "if" (0x82e430)
    "when" (0x82e530)
    "let*" (0x82e6e0)
    "mumamo-indent-line-function-1" (0x82e790)
    "let" (0x82ea90)
    "or" (0x82ebd0)
    "while" (0x82ed70)
    "let" (0x82ef60)
    "save-excursion" (0x82f0c0)
    "mumamo-indent-region-function" (0x82f204)
    "indent-region" (0x82f3a0)
    "eval" (0x82f5d4)
    "eval-expression" (0x82f814)
    "call-interactively" (0x82fb44)
    (gdb) c
    Continuing.

    Breakpoint 3, Fundo_boundary () at undo.c:303
    303       if (EQ (current_buffer->undo_list, Qt))
    (gdb) xbacktrace
    "insert" (0x82d540)
    "if" (0x82d7a0)
    "save-current-buffer" (0x82d900)
    "with-current-buffer" (0x82da00)
    "let*" (0x82dbb0)
    "if" (0x82dd30)
    "unless" (0x82de30)
    "let" (0x82e000)
    "mumamo-template-indent-get-chunk-shift" (0x82e0b0)
    "let" (0x82e3b0)
    "cond" (0x82e530)
    "let*" (0x82e6e0)
    "mumamo-indent-line-function-1" (0x82e790)
    "let" (0x82ea90)
    "or" (0x82ebd0)
    "while" (0x82ed70)
    "let" (0x82ef60)
    "save-excursion" (0x82f0c0)
    "mumamo-indent-region-function" (0x82f204)
    "indent-region" (0x82f3a0)
    "eval" (0x82f5d4)
    "eval-expression" (0x82f814)
    "call-interactively" (0x82fb44)
    (gdb) c
    Continuing.

    Breakpoint 3, Fundo_boundary () at undo.c:303
    303       if (EQ (current_buffer->undo_list, Qt))
    (gdb) xbacktrace
    "indent-line-to" (0x82e040)
    "progn" (0x82e2f0)
    "if" (0x82e430)
    "when" (0x82e530)
    "let*" (0x82e6e0)
    "mumamo-indent-line-function-1" (0x82e790)
    "let" (0x82ea90)
    "or" (0x82ebd0)
    "while" (0x82ed70)
    "let" (0x82ef60)
    "save-excursion" (0x82f0c0)
    "mumamo-indent-region-function" (0x82f204)
    "indent-region" (0x82f3a0)
    "eval" (0x82f5d4)
    "eval-expression" (0x82f814)
    "call-interactively" (0x82fb44)
    (gdb) c
    Continuing.

    Breakpoint 3, Fundo_boundary () at undo.c:303
    303       if (EQ (current_buffer->undo_list, Qt))
    (gdb) xbacktrace
    "insert" (0x82d540)
    "if" (0x82d7a0)
    "save-current-buffer" (0x82d900)
    "with-current-buffer" (0x82da00)
    "let*" (0x82dbb0)
    "if" (0x82dd30)
    "unless" (0x82de30)
    "let" (0x82e000)
    "mumamo-template-indent-get-chunk-shift" (0x82e0b0)
    "let" (0x82e3b0)
    "cond" (0x82e530)
    "let*" (0x82e6e0)
    "mumamo-indent-line-function-1" (0x82e790)
    "let" (0x82ea90)
    "or" (0x82ebd0)
    "while" (0x82ed70)
    "let" (0x82ef60)
    "save-excursion" (0x82f0c0)
    "mumamo-indent-region-function" (0x82f204)
    "indent-region" (0x82f3a0)
    "eval" (0x82f5d4)
    "eval-expression" (0x82f814)
    "call-interactively" (0x82fb44)
    (gdb) c
    Continuing.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14 22:32             ` Lennart Borgman
@ 2010-02-14 22:49               ` Lennart Borgman
  2010-02-16  0:06                 ` Lennart Borgman
  2010-02-15  3:57               ` Eli Zaretskii
  1 sibling, 1 reply; 11+ messages in thread
From: Lennart Borgman @ 2010-02-14 22:49 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan Monnier; +Cc: emacs-devel

On Sun, Feb 14, 2010 at 11:32 PM, Lennart Borgman
<lennart.borgman@gmail.com> wrote:
>
> The xbacktrace:s are here, just in case I misunderstand this:
>
>    Breakpoint 3, Fundo_boundary () at undo.c:303
>    303       if (EQ (current_buffer->undo_list, Qt))
>    (gdb) xbacktrace
>    "nxml-indent-line" (0x82d7b4)
>    "funcall" (0x82d7b0)


The bt backtrace looks more useful. It looks like the undo boundaries
are coming from sequences like this:

    (gdb) bt
    #0  Fundo_boundary () at undo.c:303
    #1  0x0102e079 in record_marker_adjustment (marker=61172811,
adjustment=-80) at undo.c:211
    #2  0x0114df23 in adjust_markers_for_delete (from=1, from_byte=1,
to=86, to_byte=86) at insdel.c:373
    #3  0x0115149c in del_range_2 (from=1, from_byte=1, to=86,
to_byte=86, ret_string=0) at insdel.c:1946
    #4  0x01151044 in del_range_1 (from=1, to=86, prepare=1,
ret_string=0) at insdel.c:1814
    #5  0x01150f4e in del_range (from=1, to=86) at insdel.c:1782

and

    (gdb) bt
    #0  Fundo_boundary () at undo.c:303
    #1  0x0102dd77 in record_point (pt=35) at undo.c:90
    #2  0x0102debc in record_insert (beg=35, length=13) at undo.c:141
    #3  0x0114f1ce in insert_from_string_1 (string=60834385, pos=0,
pos_byte=0, nchars=13, nbytes=13, inherit=0,
        before_markers=0) at insdel.c:1098
    #4  0x0114efa7 in insert_from_string (string=60834385, pos=0,
pos_byte=0, length=13, length_byte=13, inherit=0)
        at insdel.c:1022
    #5  0x010aa7ef in general_insert_function (insert_func=0x114e834 <insert>,
        insert_from_string_func=0x114ef53 <insert_from_string>,
inherit=0, nargs=1, args=0x82d540) at editfns.c:2201
    #6  0x010aa85a in Finsert (nargs=1, args=0x1f) at editfns.c:2245

Below are full bt from the above:

    (gdb) bt
    #0  Fundo_boundary () at undo.c:303
    #1  0x0102e079 in record_marker_adjustment (marker=61359803,
adjustment=-2) at undo.c:211
    #2  0x0114df23 in adjust_markers_for_delete (from=68,
from_byte=68, to=70, to_byte=70) at insdel.c:373
    #3  0x0115149c in del_range_2 (from=68, from_byte=68, to=70,
to_byte=70, ret_string=0) at insdel.c:1946
    #4  0x01151044 in del_range_1 (from=68, to=70, prepare=1,
ret_string=0) at insdel.c:1814
    #5  0x01150f4e in del_range (from=68, to=70) at insdel.c:1782
    #6  0x010ad02b in Fdelete_region (start=272, end=280) at editfns.c:3184
    #7  0x0116ae68 in Fbyte_code (bytestr=19484841, vector=19484861,
maxdepth=16) at bytecode.c:1425
    #8  0x01023c01 in funcall_lambda (fun=19484805, nargs=1,
arg_vector=0x82e040) at eval.c:3211
    #9  0x010238ec in apply_lambda (fun=19484805, args=58808382,
eval_flag=1) at eval.c:3135
    #10 0x010227be in Feval (form=58808374) at eval.c:2388
    #11 0x0101f675 in Fprogn (args=61050782) at eval.c:415
    #12 0x010223c2 in Feval (form=61050774) at eval.c:2293
    #13 0x0101f5a2 in Fif (args=61050758) at eval.c:363
    #14 0x010223c2 in Feval (form=61050750) at eval.c:2293
    #15 0x0102287f in Feval (form=58808358) at eval.c:2404
    #16 0x0101f675 in Fprogn (args=58808398) at eval.c:415
    #17 0x01020541 in FletX (args=58748758) at eval.c:1012
    #18 0x010223c2 in Feval (form=58750438) at eval.c:2293
    #19 0x0101f675 in Fprogn (args=58808470) at eval.c:415
    #20 0x01023bb5 in funcall_lambda (fun=58808478, nargs=3,
arg_vector=0x82e790) at eval.c:3204
    #21 0x010238ec in apply_lambda (fun=58808478, args=58804846,
eval_flag=1) at eval.c:3135
    #22 0x010228a9 in Feval (form=58804838) at eval.c:2406
    #23 0x010206b5 in Flet (args=58804886) at eval.c:1052
    #24 0x010223c2 in Feval (form=58804822) at eval.c:2293
    #25 0x0101f4f7 in For (args=58805062) at eval.c:311
    #26 0x010223c2 in Feval (form=58804766) at eval.c:2293
    #27 0x0101f675 in Fprogn (args=58805070) at eval.c:415
    #28 0x01020837 in Fwhile (args=58804758) at eval.c:1090
    #29 0x010223c2 in Feval (form=58804606) at eval.c:2293
    #30 0x0101f675 in Fprogn (args=58805142) at eval.c:415
    #31 0x0102077e in Flet (args=58804550) at eval.c:1068
    #32 0x010223c2 in Feval (form=58804238) at eval.c:2293
    #33 0x0101f675 in Fprogn (args=58805198) at eval.c:415
    #34 0x010a7fd4 in Fsave_excursion (args=58806230) at editfns.c:1012
    #35 0x010223c2 in Feval (form=58806182) at eval.c:2293
    #36 0x0101f675 in Fprogn (args=58803206) at eval.c:415
    #37 0x01023bb5 in funcall_lambda (fun=58803214, nargs=2,
arg_vector=0x82f204) at eval.c:3204
    #38 0x01023777 in Ffuncall (nargs=3, args=0x82f200) at eval.c:3081
    #39 0x011692ab in Fbyte_code (bytestr=19486977, vector=19486997,
maxdepth=12) at bytecode.c:679
    #40 0x01023c01 in funcall_lambda (fun=19486917, nargs=2,
arg_vector=0x82f3a0) at eval.c:3211
    #41 0x010238ec in apply_lambda (fun=19486917, args=61655158,
eval_flag=1) at eval.c:3135
    #42 0x010227be in Feval (form=61655166) at eval.c:2388
    #43 0x010234c3 in Ffuncall (nargs=2, args=0x82f5d0) at eval.c:3024
    #44 0x011692ab in Fbyte_code (bytestr=19335121, vector=19335141,
maxdepth=20) at bytecode.c:679
    #45 0x01023c01 in funcall_lambda (fun=19335069, nargs=2,
arg_vector=0x82f814) at eval.c:3211
    #46 0x010236e0 in Ffuncall (nargs=3, args=0x82f810) at eval.c:3070
    #47 0x01022bb0 in Fapply (nargs=2, args=0x82f8b0) at eval.c:2503
    #48 0x01022fda in apply1 (fn=45636330, arg=61704094) at eval.c:2773
    #49 0x01166f1b in Fcall_interactively (function=45636330,
record_flag=45279234, keys=45300485) at callint.c:396
    #50 0x01023517 in Ffuncall (nargs=4, args=0x82fb40) at eval.c:3030
    #51 0x010230af in call3 (fn=45430218, arg1=45636330,
arg2=45279234, arg3=45279234) at eval.c:2850
    #52 0x01014f56 in Fcommand_execute (cmd=45636330,
record_flag=45279234, keys=45279234, special=45279234)
        at keyboard.c:10507
    #53 0x0100789b in command_loop_1 () at keyboard.c:1904
    #54 0x01020fe4 in internal_condition_case (bfun=0x100621d
<command_loop_1>, handlers=45335770,
        hfun=0x1005c0e <cmd_error>) at eval.c:1490
    #55 0x01005f82 in command_loop_2 () at keyboard.c:1360
    #56 0x01020ad5 in internal_catch (tag=45334962, func=0x1005f5f
<command_loop_2>, arg=45279234) at eval.c:1226
    #57 0x01005f38 in command_loop () at keyboard.c:1339
    #58 0x0100582a in recursive_edit_1 () at keyboard.c:954
    #59 0x0100598e in Frecursive_edit () at keyboard.c:1016
    #60 0x010027e6 in main (argc=4, argv=0xa92980) at emacs.c:1833

    Lisp Backtrace:
    "indent-line-to" (0x82e040)

and

    (gdb) bt
    #0  Fundo_boundary () at undo.c:303
    #1  0x0102dd77 in record_point (pt=35) at undo.c:90
    #2  0x0102debc in record_insert (beg=35, length=13) at undo.c:141
    #3  0x0114f1ce in insert_from_string_1 (string=60834385, pos=0,
pos_byte=0, nchars=13, nbytes=13, inherit=0,
        before_markers=0) at insdel.c:1098
    #4  0x0114efa7 in insert_from_string (string=60834385, pos=0,
pos_byte=0, length=13, length_byte=13, inherit=0)
        at insdel.c:1022
    #5  0x010aa7ef in general_insert_function (insert_func=0x114e834 <insert>,
        insert_from_string_func=0x114ef53 <insert_from_string>,
inherit=0, nargs=1, args=0x82d540) at editfns.c:2201
    #6  0x010aa85a in Finsert (nargs=1, args=0x1f) at editfns.c:2245
    #7  0x010224bf in Feval (form=58751694) at eval.c:2319
    #8  0x0101f675 in Fprogn (args=58751710) at eval.c:415
    #9  0x0101f5c2 in Fif (args=58751574) at eval.c:364
    #10 0x010223c2 in Feval (form=58751550) at eval.c:2293
    #11 0x0101f675 in Fprogn (args=61016206) at eval.c:415
    #12 0x010a801e in Fsave_current_buffer (args=61016182) at editfns.c:1028
    #13 0x010223c2 in Feval (form=61016174) at eval.c:2293
    #14 0x0102287f in Feval (form=58751534) at eval.c:2404
    #15 0x0101f675 in Fprogn (args=58751910) at eval.c:415
    #16 0x01020541 in FletX (args=58751166) at eval.c:1012
    #17 0x010223c2 in Feval (form=58752982) at eval.c:2293
    #18 0x0101f675 in Fprogn (args=61016878) at eval.c:415
    #19 0x0101f5c2 in Fif (args=61016862) at eval.c:364
    #20 0x010223c2 in Feval (form=61016854) at eval.c:2293
    #21 0x0102287f in Feval (form=58752902) at eval.c:2404
    #22 0x0101f675 in Fprogn (args=58751926) at eval.c:415
    #23 0x0102077e in Flet (args=58752894) at eval.c:1068
    #24 0x010223c2 in Feval (form=58752822) at eval.c:2293
    #25 0x0101f675 in Fprogn (args=58750126) at eval.c:415
    #26 0x01023bb5 in funcall_lambda (fun=58750134, nargs=1,
arg_vector=0x82e0b0) at eval.c:3204
    #27 0x010238ec in apply_lambda (fun=58750134, args=58747454,
eval_flag=1) at eval.c:3135
    #28 0x010228a9 in Feval (form=58747446) at eval.c:2406
    #29 0x010206b5 in Flet (args=58747478) at eval.c:1052
    #30 0x010223c2 in Feval (form=58747398) at eval.c:2293
    #31 0x0101f675 in Fprogn (args=58747630) at eval.c:415
    #32 0x0101f634 in Fcond (args=58747718) at eval.c:392
    #33 0x010223c2 in Feval (form=58747382) at eval.c:2293
    #34 0x0101f675 in Fprogn (args=58808350) at eval.c:415
    #35 0x01020541 in FletX (args=58748758) at eval.c:1012
    #36 0x010223c2 in Feval (form=58750438) at eval.c:2293
    #37 0x0101f675 in Fprogn (args=58808470) at eval.c:415
    #38 0x01023bb5 in funcall_lambda (fun=58808478, nargs=3,
arg_vector=0x82e790) at eval.c:3204
    #39 0x010238ec in apply_lambda (fun=58808478, args=58804846,
eval_flag=1) at eval.c:3135
    #40 0x010228a9 in Feval (form=58804838) at eval.c:2406
    #41 0x010206b5 in Flet (args=58804886) at eval.c:1052
    #42 0x010223c2 in Feval (form=58804822) at eval.c:2293
    #43 0x0101f4f7 in For (args=58805062) at eval.c:311
    #44 0x010223c2 in Feval (form=58804766) at eval.c:2293
    #45 0x0101f675 in Fprogn (args=58805070) at eval.c:415
    #46 0x01020837 in Fwhile (args=58804758) at eval.c:1090
    #47 0x010223c2 in Feval (form=58804606) at eval.c:2293
    #48 0x0101f675 in Fprogn (args=58805142) at eval.c:415
    #49 0x0102077e in Flet (args=58804550) at eval.c:1068
    #50 0x010223c2 in Feval (form=58804238) at eval.c:2293
    #51 0x0101f675 in Fprogn (args=58805198) at eval.c:415
    #52 0x010a7fd4 in Fsave_excursion (args=58806230) at editfns.c:1012
    #53 0x010223c2 in Feval (form=58806182) at eval.c:2293
    #54 0x0101f675 in Fprogn (args=58803206) at eval.c:415
    #55 0x01023bb5 in funcall_lambda (fun=58803214, nargs=2,
arg_vector=0x82f204) at eval.c:3204
    #56 0x01023777 in Ffuncall (nargs=3, args=0x82f200) at eval.c:3081
    #57 0x011692ab in Fbyte_code (bytestr=19486977, vector=19486997,
maxdepth=12) at bytecode.c:679
    #58 0x01023c01 in funcall_lambda (fun=19486917, nargs=2,
arg_vector=0x82f3a0) at eval.c:3211
    #59 0x010238ec in apply_lambda (fun=19486917, args=61655158,
eval_flag=1) at eval.c:3135
    #60 0x010227be in Feval (form=61655166) at eval.c:2388
    #61 0x010234c3 in Ffuncall (nargs=2, args=0x82f5d0) at eval.c:3024
    #62 0x011692ab in Fbyte_code (bytestr=19335121, vector=19335141,
maxdepth=20) at bytecode.c:679
    #63 0x01023c01 in funcall_lambda (fun=19335069, nargs=2,
arg_vector=0x82f814) at eval.c:3211
    #64 0x010236e0 in Ffuncall (nargs=3, args=0x82f810) at eval.c:3070
    #65 0x01022bb0 in Fapply (nargs=2, args=0x82f8b0) at eval.c:2503
    #66 0x01022fda in apply1 (fn=45636330, arg=61704094) at eval.c:2773
    #67 0x01166f1b in Fcall_interactively (function=45636330,
record_flag=45279234, keys=45300485) at callint.c:396
    #68 0x01023517 in Ffuncall (nargs=4, args=0x82fb40) at eval.c:3030
    #69 0x010230af in call3 (fn=45430218, arg1=45636330,
arg2=45279234, arg3=45279234) at eval.c:2850
    #70 0x01014f56 in Fcommand_execute (cmd=45636330,
record_flag=45279234, keys=45279234, special=45279234)
        at keyboard.c:10507
    #71 0x0100789b in command_loop_1 () at keyboard.c:1904
    #72 0x01020fe4 in internal_condition_case (bfun=0x100621d
<command_loop_1>, handlers=45335770,
        hfun=0x1005c0e <cmd_error>) at eval.c:1490
    #73 0x01005f82 in command_loop_2 () at keyboard.c:1360
    #74 0x01020ad5 in internal_catch (tag=45334962, func=0x1005f5f
<command_loop_2>, arg=45279234) at eval.c:1226
    #75 0x01005f38 in command_loop () at keyboard.c:1339
    #76 0x0100582a in recursive_edit_1 () at keyboard.c:954
    #77 0x0100598e in Frecursive_edit () at keyboard.c:1016
    #78 0x010027e6 in main (argc=4, argv=0xa92980) at emacs.c:1833

    Lisp Backtrace:
    "insert" (0x82d540)




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14 21:31           ` Lennart Borgman
  2010-02-14 22:32             ` Lennart Borgman
@ 2010-02-15  3:56             ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2010-02-15  3:56 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: emacs-devel

> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Sun, 14 Feb 2010 22:31:05 +0100
> Cc: emacs-devel@gnu.org
> 
> Thanks Eli, worked much better. (Are you following gdb development
> since you knew what DWARF-2 debug info is?)

Yes.  See also nt/configure.bat: we switched to using DWARF-2 debug
info in Emacs 23.1, because that gives the debugger more information.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14 22:32             ` Lennart Borgman
  2010-02-14 22:49               ` Lennart Borgman
@ 2010-02-15  3:57               ` Eli Zaretskii
  1 sibling, 0 replies; 11+ messages in thread
From: Eli Zaretskii @ 2010-02-15  3:57 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: emacs-devel

> From: Lennart Borgman <lennart.borgman@gmail.com>
> Date: Sun, 14 Feb 2010 23:32:25 +0100
> Cc: emacs-devel@gnu.org
> 
> Looks like I need some more hand-helding. I put a breakpoint here
> 
>     (gdb) b Fundo_boundary
> 
> and executed in Emacs
> 
>     M-: (indent-region 1 (point-max))
> 
> and then called xbacktrace at each stop at Fundo_boundary. There were
> five lines in the region and on each of them Fundo_boundary was called
> but I do not understand how. I thought xbacktrace should give me
> information about it, but it does not seem to do that as far as I can
> see. So I guess I have to call bt instead, or?

As you discovered, you need both bt and xbacktrace.  (Actually, bt
should invoke xbacktrace automatically for you.)




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Unwanted undo-boundary
  2010-02-14 22:49               ` Lennart Borgman
@ 2010-02-16  0:06                 ` Lennart Borgman
  0 siblings, 0 replies; 11+ messages in thread
From: Lennart Borgman @ 2010-02-16  0:06 UTC (permalink / raw)
  To: Eli Zaretskii, Stefan Monnier; +Cc: emacs-devel

On Sun, Feb 14, 2010 at 11:49 PM, Lennart Borgman
<lennart.borgman@gmail.com> wrote:
> On Sun, Feb 14, 2010 at 11:32 PM, Lennart Borgman
> <lennart.borgman@gmail.com> wrote:
>>
>> The xbacktrace:s are here, just in case I misunderstand this:
>>
>>    Breakpoint 3, Fundo_boundary () at undo.c:303
>>    303       if (EQ (current_buffer->undo_list, Qt))
>>    (gdb) xbacktrace
>>    "nxml-indent-line" (0x82d7b4)
>>    "funcall" (0x82d7b0)
>
>
> The bt backtrace looks more useful. It looks like the undo boundaries
> are coming from sequences like this:
>
>    (gdb) bt
>    #0  Fundo_boundary () at undo.c:303
>    #1  0x0102e079 in record_marker_adjustment (marker=61172811,
> adjustment=-80) at undo.c:211
>    #2  0x0114df23 in adjust_markers_for_delete (from=1, from_byte=1,
> to=86, to_byte=86) at insdel.c:373
>    #3  0x0115149c in del_range_2 (from=1, from_byte=1, to=86,
> to_byte=86, ret_string=0) at insdel.c:1946
>    #4  0x01151044 in del_range_1 (from=1, to=86, prepare=1,
> ret_string=0) at insdel.c:1814
>    #5  0x01150f4e in del_range (from=1, to=86) at insdel.c:1782
>
> and
>
>    (gdb) bt
>    #0  Fundo_boundary () at undo.c:303
>    #1  0x0102dd77 in record_point (pt=35) at undo.c:90
>    #2  0x0102debc in record_insert (beg=35, length=13) at undo.c:141
>    #3  0x0114f1ce in insert_from_string_1 (string=60834385, pos=0,
> pos_byte=0, nchars=13, nbytes=13, inherit=0,
>        before_markers=0) at insdel.c:1098
>    #4  0x0114efa7 in insert_from_string (string=60834385, pos=0,
> pos_byte=0, length=13, length_byte=13, inherit=0)
>        at insdel.c:1022
>    #5  0x010aa7ef in general_insert_function (insert_func=0x114e834 <insert>,
>        insert_from_string_func=0x114ef53 <insert_from_string>,
> inherit=0, nargs=1, args=0x82d540) at editfns.c:2201
>    #6  0x010aa85a in Finsert (nargs=1, args=0x1f) at editfns.c:2245
>
> Below are full bt from the above:
>
>    (gdb) bt


I do not really understand the intended behaviour for Emacs here, but
in the case of nXhtml I fixed this by disabling undo in the other
buffer involved. (It should have been disabled before, but I forgot to
do it.)




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2010-02-16  0:06 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-13 13:56 Unwanted undo-boundary Lennart Borgman
     [not found] ` <jwv3a15nf3k.fsf-monnier+emacs@gnu.org>
2010-02-14  0:30   ` Lennart Borgman
2010-02-14  4:14     ` Eli Zaretskii
2010-02-14  8:20       ` Lennart Borgman
2010-02-14 18:03         ` Eli Zaretskii
2010-02-14 21:31           ` Lennart Borgman
2010-02-14 22:32             ` Lennart Borgman
2010-02-14 22:49               ` Lennart Borgman
2010-02-16  0:06                 ` Lennart Borgman
2010-02-15  3:57               ` Eli Zaretskii
2010-02-15  3:56             ` Eli Zaretskii

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).