emacs-devel
[Top][All Lists]
Advanced

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

Re: transpose-regions


From: Kim F. Storm
Subject: Re: transpose-regions
Date: Thu, 22 Mar 2007 15:49:57 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.96 (gnu/linux)

martin rudalics <address@hidden> writes:

> I'm quite frequently harassed by reports like
>
> Debugger entered--Lisp error: (wrong-type-argument listp 4297150)
>   transpose-regions(44516 44561 44561 44599)
>
> Debugger entered--Lisp error: (wrong-type-argument listp 4479113)
>   transpose-regions(64984 65044 65044 65059)
>
> Debugger entered--Lisp error: (wrong-type-argument listp 4626696)
>   transpose-regions(130041 130061 130061 130225)
>
> Erratically and unreproducible.  Apparently, the transposed regions are
> always adjacent, I don't see a common pattern as far as their sizes are
> concerned.
>
> Breaking at Fsignal gave:
>
> #0  Fsignal (error_symbol=23761593, data=24130861) at eval.c:1620
> #1  0x0100cd68 in xsignal (error_symbol=23761593, data=24130861) at 
> eval.c:1722
> #2  0x0100cfb7 in xsignal2 () at eval.c:1746
> #3  0x01004620 in pure_write_error () at data.c:121
> #4  0x0107e521 in Flength (sequence=35483205) at fns.c:185
> #5  0x0107f1e0 in concat (nargs=1, args=0xd2f280, target_type=Lisp_Cons, 
> last_special=0) at fns.c:608
> #6  0x0107f873 in Fcopy_sequence (arg=35483205) at fns.c:537
> #7  0x0111ac12 in copy_properties (source=0x21db988, target=0x1eb79c0) at 
> intervals.c:106
> #8  0x0111be5f in graft_intervals_into_buffer (source=0x21db9f8, 
> position=4778, length=322, buffer=0x20a2a00, inherit=0) at intervals.c:1842
> #9  0x0108f6fb in Ftranspose_regions (startr1=38216, endr1=40792, 
> startr2=40792, endr2=40800, leave_markers=23697409) at editfns.c:4214
> #10 0x0100c87b in Ffuncall (nargs=5, args=0xd2f590) at eval.c:3011
> #11 0x0110f83f in Fbyte_code (bytestr=33408387, vector=33639812, maxdepth=40) 
> at bytecode.c:679
> #12 0x0100bdcd in Feval (form=33251485) at eval.c:2334
> #13 0x0100e1da in internal_lisp_condition_case (var=23697409, 
> bodyform=33251485, handlers=33250773) at eval.c:1426
> #14 0x0110ffe0 in Fbyte_code (bytestr=33408403, vector=33639684, maxdepth=24) 
> at bytecode.c:869
> #15 0x0100c274 in funcall_lambda (fun=33034660, nargs=0, arg_vector=0xd2f924) 
> at eval.c:3184
> #16 0x0100c6c6 in Ffuncall (nargs=1, args=0xd2f920) at eval.c:3054
> #17 0x0100df03 in apply1 (fn=33611281, arg=23697409) at eval.c:2738
> #18 0x0110e61c in Fcall_interactively (function=33611281, 
> record_flag=23697409, keys=23756804) at callint.c:406
> #19 0x01057506 in Fcommand_execute (cmd=33611281, record_flag=23697409, 
> keys=23697409, special=23697409) at keyboard.c:10013
> #20 0x0105e2bd in command_loop_1 () at keyboard.c:1873
> #21 0x0100aa24 in internal_condition_case (bfun=0x105df60 <command_loop_1>, 
> handlers=23761545, hfun=0x1057f40 <cmd_error>) at eval.c:1481
> #22 0x01051f6e in command_loop_2 () at keyboard.c:1329
> #23 0x0100a949 in internal_catch (tag=23755777, func=0x1051f40 
> <command_loop_2>, arg=23697409) at eval.c:1222
> #24 0x01051d7e in command_loop () at keyboard.c:1308
> #25 0x01051e1f in recursive_edit_1 () at keyboard.c:1006
> #26 0x01051f1c in Frecursive_edit () at keyboard.c:1067
> #27 0x01002a75 in main (argc=1, argv=0x19a06a0) at emacs.c:1761
> #28 0x010011e7 in _end__ ()
> #29 0x01001238 in mainCRTStartup ()
> #30 0xbff7b9e4 in _libwinspool_a_iname ()
> #31 0xbff7b896 in _libwinspool_a_iname ()
> #32 0xbff7a24f in _libwinspool_a_iname ()

Martin sent me this additional info:

Hmmm ...

(gdb) xbacktrace
"transpose-regions" (0xc6c0)
"byte-code" (0x1fd43b3)
"m&d-drag-line-up" (0x1699801)
"call-interactively" (0x2002229)
(gdb) up 6
#6  0x0107f873 in Fcopy_sequence (arg=35173925) at fns.c:537
(gdb) pp arg

Program received signal SIGILL, Illegal instruction.
0x00d2ec07 in ?? ()
(gdb) pp arg
(gdb) ppt
BUF PT: 7879 of 1..132090 GAP: 132090 SZ=2000

.. where

(defun m&d-drag-line-up (&optional beg end)
  "Drag region up by one line. Region defaults to current line.
Region is always rounded up to whole lines."
  (interactive)
  (let* ((beg (save-excursion
                (goto-char
                 (or beg (and mark-active (min (point) (mark))) (point)))
                (line-beginning-position)))
         (end (save-excursion
                (goto-char
                 (or end (and mark-active (max (point) (mark)))
                     (line-beginning-position 2)))
                (if (bolp) (point) (line-beginning-position 2))))
         (point-beg (and (<= beg (point)) (<= (point) end)
                         (- (point) beg)))
         (mark-beg (and mark-active (<= beg (mark)) (<= (mark) end)
                        (- (mark) beg)))
         (from (save-excursion
                 (goto-char beg)
                 (line-beginning-position 0)))
         (recenter (when (= from (window-start))
                     (count-lines beg end))))
    (condition-case nil
        ;; Wrapped in condition-case until we find out why `transpose-regions'
        ;; is broken.
        (if (> beg from)
            (progn
              (if (save-excursion (goto-char end) (not (bolp)))
                  ;; Probably at eob.
                  (transpose-regions from (1- beg) beg end)
                (transpose-regions from beg beg end))
              (when mark-beg
                (set-mark (+ mark-beg from))
                (setq deactivate-mark nil))
              (when point-beg
                (goto-char (+ point-beg from)))
              (when recenter
                (recenter recenter)))
          (m&d-ensure-mark)
          (message "Can't drag")
          (ding))
      (error (m&d-ensure-mark)))))

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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