From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#19650: Date: Thu, 12 Mar 2015 21:19:41 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1426209624 27583 80.91.229.3 (13 Mar 2015 01:20:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Mar 2015 01:20:24 +0000 (UTC) Cc: 19650@debbugs.gnu.org, Fabian Ezequiel Gallina To: Carlos Pita Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Mar 13 02:20:11 2015 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 1YWEGo-0000YV-8O for geb-bug-gnu-emacs@m.gmane.org; Fri, 13 Mar 2015 02:20:10 +0100 Original-Received: from localhost ([::1]:34652 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWEGn-0001Lv-Eh for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Mar 2015 21:20:09 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWEGk-0001Jg-4S for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 21:20:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWEGg-0005F6-VE for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 21:20:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45856) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWEGg-0005Es-RT for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 21:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YWEGg-0008AX-Bf for bug-gnu-emacs@gnu.org; Thu, 12 Mar 2015 21:20:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Mar 2015 01:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19650 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 19650-submit@debbugs.gnu.org id=B19650.142620958831363 (code B ref 19650); Fri, 13 Mar 2015 01:20:02 +0000 Original-Received: (at 19650) by debbugs.gnu.org; 13 Mar 2015 01:19:48 +0000 Original-Received: from localhost ([127.0.0.1]:44424 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWEGS-00089l-A9 for submit@debbugs.gnu.org; Thu, 12 Mar 2015 21:19:48 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:28471) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YWEGR-00089T-3K for 19650@debbugs.gnu.org; Thu, 12 Mar 2015 21:19:47 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArsTAPOG1lRFxLnr/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJC6ICgjOIwEBAQcCAR+PeAeEKgWZX4MDhhSGfIFFIoQKIoEzJIEcAQEB X-IPAS-Result: ArsTAPOG1lRFxLnr/2dsb2JhbABbgwaDX4VTwGUEAgKBDUQBAQEBAQF8hA0BBAFWIwULCzQSFBgNJC6ICgjOIwEBAQcCAR+PeAeEKgWZX4MDhhSGfIFFIoQKIoEzJIEcAQEB X-IronPort-AV: E=Sophos;i="5.09,536,1418101200"; d="scan'208";a="113425953" Original-Received: from 69-196-185-235.dsl.teksavvy.com (HELO pastel.home) ([69.196.185.235]) by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 12 Mar 2015 21:19:41 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 4A9DFB07; Thu, 12 Mar 2015 21:19:41 -0400 (EDT) In-Reply-To: (Stefan Monnier's message of "Thu, 12 Mar 2015 15:10:56 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:100425 Archived-At: > 1) Changing insert for insert-before-markers is problematic because it > somehow wreaks havoc with font locking. I guess some other markers are > being moved around besides he-string-end, maybe the one pointing to > the end of the prompt or something like that (since everything gets > colored the same the prompt is). Moreover, the he-string-beg marker > would still point to the wrong place no matter what its type were. Indeed, the issue is not "insert-before" vs "insert-after" but that we delete+insert the exact same text, so the markers should simply not move, but Emacs can't know that. Basically, the delete+insert only changes the text's properties, so "the right way" to fix this is to not delete and not insert, but instead to take the result string, extract its text-properties and apply them carefully to the corresponding of the buffer, so as not to affect any marker. Another "right way" is to do the font-locking "in situ" instead of doing it in a side buffer. This would be good, but IIUC it's not as straightforward as it sounds. > 3) Same as (2) above, but saving/restoring the *positions* of both > he-string-beg and he-string-end. This is the best solution I could > figure out till now. Take a look at the attached patch, please. > What do you think? I think it's hideous, but maybe it's OK as a temporary workaround. I'll let Fabian decide if he wants it in his code. But if he accepts it, the code should have some extra comments explaining what's going on. Stefan