From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#5131: Subject: 23.1; interaction of transpose-regions with markers and multibyte chars Date: Sun, 17 Jul 2016 00:46:34 -0400 Message-ID: <874m7oeus5.fsf@users.sourceforge.net> References: <20091206042206.10974kro2g12qlhq@webmail.tau.ac.il> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1468730848 13167 80.91.229.3 (17 Jul 2016 04:47:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Jul 2016 04:47:28 +0000 (UTC) Cc: schochet@post.tau.ac.il, 5131@debbugs.gnu.org To: Andrew Hyatt Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 17 06:47:17 2016 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bOdz1-0007IZ-IU for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Jul 2016 06:47:15 +0200 Original-Received: from localhost ([::1]:40163 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOdz0-0000xR-N9 for geb-bug-gnu-emacs@m.gmane.org; Sun, 17 Jul 2016 00:47:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOdyu-0000xM-S9 for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 00:47:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bOdyo-0004jy-PA for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 00:47:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41841) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bOdyo-0004ju-LE for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 00:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1bOdyo-0004Bd-5F for bug-gnu-emacs@gnu.org; Sun, 17 Jul 2016 00:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 17 Jul 2016 04:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5131 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5131-submit@debbugs.gnu.org id=B5131.146873080316069 (code B ref 5131); Sun, 17 Jul 2016 04:47:02 +0000 Original-Received: (at 5131) by debbugs.gnu.org; 17 Jul 2016 04:46:43 +0000 Original-Received: from localhost ([127.0.0.1]:54178 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOdyU-0004B6-QY for submit@debbugs.gnu.org; Sun, 17 Jul 2016 00:46:43 -0400 Original-Received: from mail-it0-f46.google.com ([209.85.214.46]:37240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bOdyS-0004Au-GZ for 5131@debbugs.gnu.org; Sun, 17 Jul 2016 00:46:41 -0400 Original-Received: by mail-it0-f46.google.com with SMTP id f6so49444991ith.0 for <5131@debbugs.gnu.org>; Sat, 16 Jul 2016 21:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=aVvZGyTnzJAIMgtw1Kti0Mx+dP2xDFZRpI5rsCxntH0=; b=Tp77D15PkgW6crnlDvDqMER3Nk2IRY+HUOstWpuSZnpOQZuPXyj/I6auRHa1aIU6hj DM6oxVRwQRFh4HxvROSaDPmeJlQz8ywFtdjxZeKZ/IIEcZ8lwCO6qwpO08mcskIK1uxH uOh+JK1HaK2YZR1fuOxo7eeBKygan1ZrF+Cm0RXaPFsCa1y1jee0Uq9NjAZXVOqyGCCW 9v3z2DWpzgFF5WahRi16kHvFXV333OiWrkujpItAtT0ft2hx/eF5mA+aYzore+NjoEMZ DbW54sqmT2+agxaPzh/S6fXVvcSBnp37J52HMAr+NHe6I18tJHut09IjVG2XETJAyU3A cRjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version :content-transfer-encoding; bh=aVvZGyTnzJAIMgtw1Kti0Mx+dP2xDFZRpI5rsCxntH0=; b=KwDO7oSCD1eqF0TPR5Va46ym+a2ZfimsRY1A6KOb47545UQUZCAmo4zbUHQTIKv90j kCm7FPw4R6nFsnWNkC8DOIKV+EvspspECZMJt4h4CIWkWMHv5gu6QLTerEwDpEWS3A7e r6iXFA880LB4Chd9E5NZo7ZORCHe4gJeDVqLnecxW+iTuV8B1jeyTZ9EdpvWJNxDyMAn Sov51HfRhPXxWF6i1ZXMOeU7E+OVwtpfbAzrFIXzOSfQFhbM8oCbEAQplSXliA5C0iUZ GkrJuFb/AHVSEX2cwYxK8iM/+ZDUnxw92R9LZds07jT2hfZAfRgSYx6d/eRYRtr3Z/Zc qZfQ== X-Gm-Message-State: ALyK8tLj8H2fdmZ+Hs78kOrHoGdzSV2UI8pFetYtnm2hI6wbke8DHEfYpD1v9vkCdUTBZQ== X-Received: by 10.36.69.205 with SMTP id c74mr43809702itd.47.1468730794874; Sat, 16 Jul 2016 21:46:34 -0700 (PDT) Original-Received: from zony (206-188-64-44.cpe.distributel.net. [206.188.64.44]) by smtp.googlemail.com with ESMTPSA id g125sm2300832ith.3.2016.07.16.21.46.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Jul 2016 21:46:34 -0700 (PDT) In-Reply-To: (Andrew Hyatt's message of "Sun, 17 Jul 2016 00:13:17 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:121158 Archived-At: Andrew Hyatt writes: > Sorry for the late reply. I can reproduce the problem of unexpected > characters when transposing using markers in Emacs 25. > > schochet@post.tau.ac.il writes: > >> ;-*- mode: lisp-interaction; coding: utf-8-unix -*- >> >> ; case 1: abcd was: abcd >> ; case 2: =C3=B7bcd was: =C3=B7bcd >> ; case 3: =C3=B7ab"=C3=A4=C3=A9 was: =C3=B7ab"=C3=A4=C3=A9 >> >> (progn (defvar start nil) (defvar len nil)) ;do \C-j here >> >> ; Using markers to move multi-byte characters may cause problems >> >> (progn (setq begm (make-marker)) (setq endm (make-marker))) ;do \C-j here >> >> (defun reverse-all () >> (set-marker begm start) >> (set-marker endm (+ start (1- len))) >> (while (> endm begm) >> (progn (transpose-regions begm (1+ begm) endm (1+ endm) t) >> (set-marker begm (1+ begm)) >> (set-marker endm (1- endm))))) ;do \C-j here >> >> ;case1 >> (progn (setq start 64) (setq len 4) (reverse-all)) ;do \C-j here >> >> ;case2 >> (progn (setq start 94) (setq len 4) (reverse-all)) ;do \C-j here >> >> ;case3 >> (progn (setq start 124) (setq len 6) (reverse-all)) ;do \C-j here With the latest emacs-25 branch after evaluating up to case3 here, I get an abort, here is the backtrace: (gdb) bt #0 0x00007ffff1218d59 in raise () from /usr/lib/libpthread.so.0 #1 0x00000000005738c4 in terminate_due_to_signal (sig=3D6, backtrace_limit= =3D2147483647) at emacs.c:381 #2 0x0000000000600d84 in die (msg=3D0x6f4140 "IT_BYTEPOS (*it) =3D=3D CHAR= _TO_BYTE (IT_CHARPOS (*it))", file=3D0x6f1ff0 "xdisp.c",=20 line=3D7442) at alloc.c:7223 #3 0x0000000000452c1c in set_iterator_to_next (it=3D0x7fffffff90f0, reseat= _p=3Dtrue) at xdisp.c:7442 #4 0x00000000004832b4 in display_line (it=3D0x7fffffff90f0) at xdisp.c:209= 97 #5 0x00000000004793af in try_window_id (w=3D0x13fc690) at xdisp.c:18413 #6 0x000000000046fd44 in redisplay_window (window=3D20956821, just_this_on= e_p=3Dtrue) at xdisp.c:16573 #7 0x0000000000467ad2 in redisplay_window_1 (window=3D20956821) at xdisp.c= :14454 #8 0x0000000000621077 in internal_condition_case_1 (bfun=3D0x467a90 , arg=3D20956821, handlers=3D14478067,=20 hfun=3D0x467a0a ) at eval.c:1333 #9 0x0000000000466cbc in redisplay_internal () at xdisp.c:14079 #10 0x00000000004640c2 in redisplay () at xdisp.c:13214 #11 0x000000000057b647 in read_char (commandflag=3D1, map=3D17541507, prev_= event=3D0, used_mouse_menu=3D0x7fffffffe42f, end_time=3D0x0) at keyboard.c:2477 #12 0x000000000058b90f in read_key_sequence (keybuf=3D0x7fffffffe5e0, bufsi= ze=3D30, prompt=3D0, dont_downcase_last=3Dfalse,=20 can_return_switch_frame=3Dtrue, fix_current_buffer=3Dtrue, prevent_redi= splay=3Dfalse) at keyboard.c:9063 #13 0x000000000057854d in command_loop_1 () at keyboard.c:1365 #14 0x0000000000620fdd in internal_condition_case (bfun=3D0x57810b , handlers=3D19056, hfun=3D0x577779 ) at eval.c:1309 #15 0x0000000000577d38 in command_loop_2 (ignore=3D0) at keyboard.c:1107 #16 0x000000000062056f in internal_catch (tag=3D45840, func=3D0x577d0f , arg=3D0) at eval.c:1074 #17 0x0000000000577cda in command_loop () at keyboard.c:1086 #18 0x0000000000577251 in recursive_edit_1 () at keyboard.c:692 #19 0x000000000057745d in Frecursive_edit () at keyboard.c:763 #20 0x00000000005751f5 in main (argc=3D3, argv=3D0x7fffffffea78) at emacs.c= :1606 Lisp Backtrace: "redisplay_internal (C function)" (0x0) In GNU Emacs 25.0.95.21 (x86_64-unknown-linux-gnu, X toolkit) of 2016-07-11 built on zony Repository revision: d1300340cbd44abe79ef71a57ae1488479f76b0d Windowing system distributor 'The X.Org Foundation', version 11.0.11803000 Configured using: 'configure --cache-file=3D../debug-config.cache 'CFLAGS=3D-O0 -g3 -march=3Dnative' --enable-checking MAKEINFO=3Dmakeinfo-4.13a --with-x-toolkit=3Dlucid --without-toolkit-scroll-bars --with-gif=3Dno --with-jpeg=3Dno'